1#![doc = "MAVLink ualberta dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[cfg(feature = "ts")]
21use ts_rs::TS;
22pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
23#[cfg_attr(feature = "ts", derive(TS))]
24#[cfg_attr(feature = "ts", ts(export))]
25#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
26#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27#[cfg_attr(feature = "serde", serde(tag = "type"))]
28#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29#[repr(u32)]
30#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
31pub enum ActuatorConfiguration {
32 #[doc = "Do nothing."]
33 ACTUATOR_CONFIGURATION_NONE = 0,
34 #[doc = "Command the actuator to beep now."]
35 ACTUATOR_CONFIGURATION_BEEP = 1,
36 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
37 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
38 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
40 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
41 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
44}
45impl ActuatorConfiguration {
46 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
47}
48impl Default for ActuatorConfiguration {
49 fn default() -> Self {
50 Self::DEFAULT
51 }
52}
53#[cfg_attr(feature = "ts", derive(TS))]
54#[cfg_attr(feature = "ts", ts(export))]
55#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
56#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
57#[cfg_attr(feature = "serde", serde(tag = "type"))]
58#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
59#[repr(u32)]
60#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
61pub enum ActuatorOutputFunction {
62 #[doc = "No function (disabled)."]
63 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
64 #[doc = "Motor 1"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
66 #[doc = "Motor 2"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
68 #[doc = "Motor 3"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
70 #[doc = "Motor 4"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
72 #[doc = "Motor 5"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
74 #[doc = "Motor 6"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
76 #[doc = "Motor 7"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
78 #[doc = "Motor 8"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
80 #[doc = "Motor 9"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
82 #[doc = "Motor 10"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
84 #[doc = "Motor 11"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
86 #[doc = "Motor 12"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
88 #[doc = "Motor 13"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
90 #[doc = "Motor 14"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
92 #[doc = "Motor 15"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
94 #[doc = "Motor 16"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
96 #[doc = "Servo 1"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
98 #[doc = "Servo 2"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
100 #[doc = "Servo 3"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
102 #[doc = "Servo 4"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
104 #[doc = "Servo 5"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
106 #[doc = "Servo 6"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
108 #[doc = "Servo 7"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
110 #[doc = "Servo 8"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
112 #[doc = "Servo 9"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
114 #[doc = "Servo 10"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
116 #[doc = "Servo 11"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
118 #[doc = "Servo 12"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
120 #[doc = "Servo 13"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
122 #[doc = "Servo 14"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
124 #[doc = "Servo 15"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
126 #[doc = "Servo 16"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
128}
129impl ActuatorOutputFunction {
130 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
131}
132impl Default for ActuatorOutputFunction {
133 fn default() -> Self {
134 Self::DEFAULT
135 }
136}
137#[cfg_attr(feature = "ts", derive(TS))]
138#[cfg_attr(feature = "ts", ts(export))]
139#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
141#[cfg_attr(feature = "serde", serde(tag = "type"))]
142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
143#[repr(u32)]
144#[doc = "Enumeration of the ADSB altimeter types"]
145pub enum AdsbAltitudeType {
146 #[doc = "Altitude reported from a Baro source using QNH reference"]
147 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
148 #[doc = "Altitude reported from a GNSS source"]
149 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
150}
151impl AdsbAltitudeType {
152 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
153}
154impl Default for AdsbAltitudeType {
155 fn default() -> Self {
156 Self::DEFAULT
157 }
158}
159#[cfg_attr(feature = "ts", derive(TS))]
160#[cfg_attr(feature = "ts", ts(export))]
161#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
163#[cfg_attr(feature = "serde", serde(tag = "type"))]
164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
165#[repr(u32)]
166#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
167pub enum AdsbEmitterType {
168 ADSB_EMITTER_TYPE_NO_INFO = 0,
169 ADSB_EMITTER_TYPE_LIGHT = 1,
170 ADSB_EMITTER_TYPE_SMALL = 2,
171 ADSB_EMITTER_TYPE_LARGE = 3,
172 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
173 ADSB_EMITTER_TYPE_HEAVY = 5,
174 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
175 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
176 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
177 ADSB_EMITTER_TYPE_GLIDER = 9,
178 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
179 ADSB_EMITTER_TYPE_PARACHUTE = 11,
180 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
181 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
182 ADSB_EMITTER_TYPE_UAV = 14,
183 ADSB_EMITTER_TYPE_SPACE = 15,
184 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
185 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
186 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
187 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
188}
189impl AdsbEmitterType {
190 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
191}
192impl Default for AdsbEmitterType {
193 fn default() -> Self {
194 Self::DEFAULT
195 }
196}
197bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
198impl AdsbFlags {
199 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
200}
201impl Default for AdsbFlags {
202 fn default() -> Self {
203 Self::DEFAULT
204 }
205}
206bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
207impl AisFlags {
208 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
209}
210impl Default for AisFlags {
211 fn default() -> Self {
212 Self::DEFAULT
213 }
214}
215#[cfg_attr(feature = "ts", derive(TS))]
216#[cfg_attr(feature = "ts", ts(export))]
217#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
219#[cfg_attr(feature = "serde", serde(tag = "type"))]
220#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
221#[repr(u32)]
222#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
223pub enum AisNavStatus {
224 #[doc = "Under way using engine."]
225 UNDER_WAY = 0,
226 AIS_NAV_ANCHORED = 1,
227 AIS_NAV_UN_COMMANDED = 2,
228 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
229 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
230 AIS_NAV_MOORED = 5,
231 AIS_NAV_AGROUND = 6,
232 AIS_NAV_FISHING = 7,
233 AIS_NAV_SAILING = 8,
234 AIS_NAV_RESERVED_HSC = 9,
235 AIS_NAV_RESERVED_WIG = 10,
236 AIS_NAV_RESERVED_1 = 11,
237 AIS_NAV_RESERVED_2 = 12,
238 AIS_NAV_RESERVED_3 = 13,
239 #[doc = "Search And Rescue Transponder."]
240 AIS_NAV_AIS_SART = 14,
241 #[doc = "Not available (default)."]
242 AIS_NAV_UNKNOWN = 15,
243}
244impl AisNavStatus {
245 pub const DEFAULT: Self = Self::UNDER_WAY;
246}
247impl Default for AisNavStatus {
248 fn default() -> Self {
249 Self::DEFAULT
250 }
251}
252#[cfg_attr(feature = "ts", derive(TS))]
253#[cfg_attr(feature = "ts", ts(export))]
254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
256#[cfg_attr(feature = "serde", serde(tag = "type"))]
257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
258#[repr(u32)]
259#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
260pub enum AisType {
261 #[doc = "Not available (default)."]
262 AIS_TYPE_UNKNOWN = 0,
263 AIS_TYPE_RESERVED_1 = 1,
264 AIS_TYPE_RESERVED_2 = 2,
265 AIS_TYPE_RESERVED_3 = 3,
266 AIS_TYPE_RESERVED_4 = 4,
267 AIS_TYPE_RESERVED_5 = 5,
268 AIS_TYPE_RESERVED_6 = 6,
269 AIS_TYPE_RESERVED_7 = 7,
270 AIS_TYPE_RESERVED_8 = 8,
271 AIS_TYPE_RESERVED_9 = 9,
272 AIS_TYPE_RESERVED_10 = 10,
273 AIS_TYPE_RESERVED_11 = 11,
274 AIS_TYPE_RESERVED_12 = 12,
275 AIS_TYPE_RESERVED_13 = 13,
276 AIS_TYPE_RESERVED_14 = 14,
277 AIS_TYPE_RESERVED_15 = 15,
278 AIS_TYPE_RESERVED_16 = 16,
279 AIS_TYPE_RESERVED_17 = 17,
280 AIS_TYPE_RESERVED_18 = 18,
281 AIS_TYPE_RESERVED_19 = 19,
282 #[doc = "Wing In Ground effect."]
283 AIS_TYPE_WIG = 20,
284 AIS_TYPE_WIG_HAZARDOUS_A = 21,
285 AIS_TYPE_WIG_HAZARDOUS_B = 22,
286 AIS_TYPE_WIG_HAZARDOUS_C = 23,
287 AIS_TYPE_WIG_HAZARDOUS_D = 24,
288 AIS_TYPE_WIG_RESERVED_1 = 25,
289 AIS_TYPE_WIG_RESERVED_2 = 26,
290 AIS_TYPE_WIG_RESERVED_3 = 27,
291 AIS_TYPE_WIG_RESERVED_4 = 28,
292 AIS_TYPE_WIG_RESERVED_5 = 29,
293 AIS_TYPE_FISHING = 30,
294 AIS_TYPE_TOWING = 31,
295 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
296 AIS_TYPE_TOWING_LARGE = 32,
297 #[doc = "Dredging or other underwater ops."]
298 AIS_TYPE_DREDGING = 33,
299 AIS_TYPE_DIVING = 34,
300 AIS_TYPE_MILITARY = 35,
301 AIS_TYPE_SAILING = 36,
302 AIS_TYPE_PLEASURE = 37,
303 AIS_TYPE_RESERVED_20 = 38,
304 AIS_TYPE_RESERVED_21 = 39,
305 #[doc = "High Speed Craft."]
306 AIS_TYPE_HSC = 40,
307 AIS_TYPE_HSC_HAZARDOUS_A = 41,
308 AIS_TYPE_HSC_HAZARDOUS_B = 42,
309 AIS_TYPE_HSC_HAZARDOUS_C = 43,
310 AIS_TYPE_HSC_HAZARDOUS_D = 44,
311 AIS_TYPE_HSC_RESERVED_1 = 45,
312 AIS_TYPE_HSC_RESERVED_2 = 46,
313 AIS_TYPE_HSC_RESERVED_3 = 47,
314 AIS_TYPE_HSC_RESERVED_4 = 48,
315 AIS_TYPE_HSC_UNKNOWN = 49,
316 AIS_TYPE_PILOT = 50,
317 #[doc = "Search And Rescue vessel."]
318 AIS_TYPE_SAR = 51,
319 AIS_TYPE_TUG = 52,
320 AIS_TYPE_PORT_TENDER = 53,
321 #[doc = "Anti-pollution equipment."]
322 AIS_TYPE_ANTI_POLLUTION = 54,
323 AIS_TYPE_LAW_ENFORCEMENT = 55,
324 AIS_TYPE_SPARE_LOCAL_1 = 56,
325 AIS_TYPE_SPARE_LOCAL_2 = 57,
326 AIS_TYPE_MEDICAL_TRANSPORT = 58,
327 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
328 AIS_TYPE_NONECOMBATANT = 59,
329 AIS_TYPE_PASSENGER = 60,
330 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
331 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
332 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
333 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
334 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
335 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
336 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
337 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
338 AIS_TYPE_PASSENGER_UNKNOWN = 69,
339 AIS_TYPE_CARGO = 70,
340 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
341 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
342 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
343 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
344 AIS_TYPE_CARGO_RESERVED_1 = 75,
345 AIS_TYPE_CARGO_RESERVED_2 = 76,
346 AIS_TYPE_CARGO_RESERVED_3 = 77,
347 AIS_TYPE_CARGO_RESERVED_4 = 78,
348 AIS_TYPE_CARGO_UNKNOWN = 79,
349 AIS_TYPE_TANKER = 80,
350 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
351 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
352 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
353 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
354 AIS_TYPE_TANKER_RESERVED_1 = 85,
355 AIS_TYPE_TANKER_RESERVED_2 = 86,
356 AIS_TYPE_TANKER_RESERVED_3 = 87,
357 AIS_TYPE_TANKER_RESERVED_4 = 88,
358 AIS_TYPE_TANKER_UNKNOWN = 89,
359 AIS_TYPE_OTHER = 90,
360 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
361 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
362 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
363 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
364 AIS_TYPE_OTHER_RESERVED_1 = 95,
365 AIS_TYPE_OTHER_RESERVED_2 = 96,
366 AIS_TYPE_OTHER_RESERVED_3 = 97,
367 AIS_TYPE_OTHER_RESERVED_4 = 98,
368 AIS_TYPE_OTHER_UNKNOWN = 99,
369}
370impl AisType {
371 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
372}
373impl Default for AisType {
374 fn default() -> Self {
375 Self::DEFAULT
376 }
377}
378bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
379impl AttitudeTargetTypemask {
380 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
381}
382impl Default for AttitudeTargetTypemask {
383 fn default() -> Self {
384 Self::DEFAULT
385 }
386}
387#[cfg_attr(feature = "ts", derive(TS))]
388#[cfg_attr(feature = "ts", ts(export))]
389#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
391#[cfg_attr(feature = "serde", serde(tag = "type"))]
392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
393#[repr(u32)]
394#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
395pub enum AutotuneAxis {
396 #[doc = "Autotune roll axis."]
397 AUTOTUNE_AXIS_ROLL = 1,
398 #[doc = "Autotune pitch axis."]
399 AUTOTUNE_AXIS_PITCH = 2,
400 #[doc = "Autotune yaw axis."]
401 AUTOTUNE_AXIS_YAW = 4,
402}
403impl AutotuneAxis {
404 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
405}
406impl Default for AutotuneAxis {
407 fn default() -> Self {
408 Self::DEFAULT
409 }
410}
411bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
412impl CameraCapFlags {
413 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
414}
415impl Default for CameraCapFlags {
416 fn default() -> Self {
417 Self::DEFAULT
418 }
419}
420#[cfg_attr(feature = "ts", derive(TS))]
421#[cfg_attr(feature = "ts", ts(export))]
422#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
424#[cfg_attr(feature = "serde", serde(tag = "type"))]
425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
426#[repr(u32)]
427#[doc = "Camera Modes."]
428pub enum CameraMode {
429 #[doc = "Camera is in image/photo capture mode."]
430 CAMERA_MODE_IMAGE = 0,
431 #[doc = "Camera is in video capture mode."]
432 CAMERA_MODE_VIDEO = 1,
433 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
434 CAMERA_MODE_IMAGE_SURVEY = 2,
435}
436impl CameraMode {
437 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
438}
439impl Default for CameraMode {
440 fn default() -> Self {
441 Self::DEFAULT
442 }
443}
444#[cfg_attr(feature = "ts", derive(TS))]
445#[cfg_attr(feature = "ts", ts(export))]
446#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
448#[cfg_attr(feature = "serde", serde(tag = "type"))]
449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
450#[repr(u32)]
451#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
452pub enum CameraSource {
453 #[doc = "Default camera source."]
454 CAMERA_SOURCE_DEFAULT = 0,
455 #[doc = "RGB camera source."]
456 CAMERA_SOURCE_RGB = 1,
457 #[doc = "IR camera source."]
458 CAMERA_SOURCE_IR = 2,
459 #[doc = "NDVI camera source."]
460 CAMERA_SOURCE_NDVI = 3,
461}
462impl CameraSource {
463 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
464}
465impl Default for CameraSource {
466 fn default() -> Self {
467 Self::DEFAULT
468 }
469}
470#[cfg_attr(feature = "ts", derive(TS))]
471#[cfg_attr(feature = "ts", ts(export))]
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking modes"]
478pub enum CameraTrackingMode {
479 #[doc = "Not tracking"]
480 CAMERA_TRACKING_MODE_NONE = 0,
481 #[doc = "Target is a point"]
482 CAMERA_TRACKING_MODE_POINT = 1,
483 #[doc = "Target is a rectangle"]
484 CAMERA_TRACKING_MODE_RECTANGLE = 2,
485}
486impl CameraTrackingMode {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
488}
489impl Default for CameraTrackingMode {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494#[cfg_attr(feature = "ts", derive(TS))]
495#[cfg_attr(feature = "ts", ts(export))]
496#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
498#[cfg_attr(feature = "serde", serde(tag = "type"))]
499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
500#[repr(u32)]
501#[doc = "Camera tracking status flags"]
502pub enum CameraTrackingStatusFlags {
503 #[doc = "Camera is not tracking"]
504 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
505 #[doc = "Camera is tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
507 #[doc = "Camera tracking in error state"]
508 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
509}
510impl CameraTrackingStatusFlags {
511 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
512}
513impl Default for CameraTrackingStatusFlags {
514 fn default() -> Self {
515 Self::DEFAULT
516 }
517}
518bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
519impl CameraTrackingTargetData {
520 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
521}
522impl Default for CameraTrackingTargetData {
523 fn default() -> Self {
524 Self::DEFAULT
525 }
526}
527#[cfg_attr(feature = "ts", derive(TS))]
528#[cfg_attr(feature = "ts", ts(export))]
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
535pub enum CameraZoomType {
536 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
537 ZOOM_TYPE_STEP = 0,
538 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
539 ZOOM_TYPE_CONTINUOUS = 1,
540 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
541 ZOOM_TYPE_RANGE = 2,
542 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
543 ZOOM_TYPE_FOCAL_LENGTH = 3,
544 #[doc = "Zoom value as horizontal field of view in degrees."]
545 ZOOM_TYPE_HORIZONTAL_FOV = 4,
546}
547impl CameraZoomType {
548 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
549}
550impl Default for CameraZoomType {
551 fn default() -> Self {
552 Self::DEFAULT
553 }
554}
555#[cfg_attr(feature = "ts", derive(TS))]
556#[cfg_attr(feature = "ts", ts(export))]
557#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
559#[cfg_attr(feature = "serde", serde(tag = "type"))]
560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
561#[repr(u32)]
562pub enum CanFilterOp {
563 CAN_FILTER_REPLACE = 0,
564 CAN_FILTER_ADD = 1,
565 CAN_FILTER_REMOVE = 2,
566}
567impl CanFilterOp {
568 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
569}
570impl Default for CanFilterOp {
571 fn default() -> Self {
572 Self::DEFAULT
573 }
574}
575#[cfg_attr(feature = "ts", derive(TS))]
576#[cfg_attr(feature = "ts", ts(export))]
577#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
579#[cfg_attr(feature = "serde", serde(tag = "type"))]
580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
581#[repr(u32)]
582#[doc = "Possible responses from a CELLULAR_CONFIG message."]
583pub enum CellularConfigResponse {
584 #[doc = "Changes accepted."]
585 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
586 #[doc = "Invalid APN."]
587 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
588 #[doc = "Invalid PIN."]
589 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
590 #[doc = "Changes rejected."]
591 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
592 #[doc = "PUK is required to unblock SIM card."]
593 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
594}
595impl CellularConfigResponse {
596 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
597}
598impl Default for CellularConfigResponse {
599 fn default() -> Self {
600 Self::DEFAULT
601 }
602}
603#[cfg_attr(feature = "ts", derive(TS))]
604#[cfg_attr(feature = "ts", ts(export))]
605#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
607#[cfg_attr(feature = "serde", serde(tag = "type"))]
608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
609#[repr(u32)]
610#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
611pub enum CellularNetworkFailedReason {
612 #[doc = "No error"]
613 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
614 #[doc = "Error state is unknown"]
615 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
616 #[doc = "SIM is required for the modem but missing"]
617 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
618 #[doc = "SIM is available, but not usable for connection"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
620}
621impl CellularNetworkFailedReason {
622 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
623}
624impl Default for CellularNetworkFailedReason {
625 fn default() -> Self {
626 Self::DEFAULT
627 }
628}
629#[cfg_attr(feature = "ts", derive(TS))]
630#[cfg_attr(feature = "ts", ts(export))]
631#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
632#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
633#[cfg_attr(feature = "serde", serde(tag = "type"))]
634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
635#[repr(u32)]
636#[doc = "Cellular network radio type"]
637pub enum CellularNetworkRadioType {
638 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
639 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
640 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
641 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
642 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
643}
644impl CellularNetworkRadioType {
645 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
646}
647impl Default for CellularNetworkRadioType {
648 fn default() -> Self {
649 Self::DEFAULT
650 }
651}
652#[cfg_attr(feature = "ts", derive(TS))]
653#[cfg_attr(feature = "ts", ts(export))]
654#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
656#[cfg_attr(feature = "serde", serde(tag = "type"))]
657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
658#[repr(u32)]
659#[doc = "These flags encode the cellular network status"]
660pub enum CellularStatusFlag {
661 #[doc = "State unknown or not reportable."]
662 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
663 #[doc = "Modem is unusable"]
664 CELLULAR_STATUS_FLAG_FAILED = 1,
665 #[doc = "Modem is being initialized"]
666 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
667 #[doc = "Modem is locked"]
668 CELLULAR_STATUS_FLAG_LOCKED = 3,
669 #[doc = "Modem is not enabled and is powered down"]
670 CELLULAR_STATUS_FLAG_DISABLED = 4,
671 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
672 CELLULAR_STATUS_FLAG_DISABLING = 5,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
674 CELLULAR_STATUS_FLAG_ENABLING = 6,
675 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
676 CELLULAR_STATUS_FLAG_ENABLED = 7,
677 #[doc = "Modem is searching for a network provider to register"]
678 CELLULAR_STATUS_FLAG_SEARCHING = 8,
679 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
680 CELLULAR_STATUS_FLAG_REGISTERED = 9,
681 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
682 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
683 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
684 CELLULAR_STATUS_FLAG_CONNECTING = 11,
685 #[doc = "One or more packet data bearers is active and connected"]
686 CELLULAR_STATUS_FLAG_CONNECTED = 12,
687}
688impl CellularStatusFlag {
689 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
690}
691impl Default for CellularStatusFlag {
692 fn default() -> Self {
693 Self::DEFAULT
694 }
695}
696#[cfg_attr(feature = "ts", derive(TS))]
697#[cfg_attr(feature = "ts", ts(export))]
698#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
700#[cfg_attr(feature = "serde", serde(tag = "type"))]
701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
702#[repr(u32)]
703#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
704pub enum CompMetadataType {
705 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
706 COMP_METADATA_TYPE_GENERAL = 0,
707 #[doc = "Parameter meta data."]
708 COMP_METADATA_TYPE_PARAMETER = 1,
709 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
710 COMP_METADATA_TYPE_COMMANDS = 2,
711 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
712 COMP_METADATA_TYPE_PERIPHERALS = 3,
713 #[doc = "Meta data for the events interface."]
714 COMP_METADATA_TYPE_EVENTS = 4,
715 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
716 COMP_METADATA_TYPE_ACTUATORS = 5,
717}
718impl CompMetadataType {
719 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
720}
721impl Default for CompMetadataType {
722 fn default() -> Self {
723 Self::DEFAULT
724 }
725}
726#[cfg_attr(feature = "ts", derive(TS))]
727#[cfg_attr(feature = "ts", ts(export))]
728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
730#[cfg_attr(feature = "serde", serde(tag = "type"))]
731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
732#[repr(u32)]
733#[doc = "Indicates the ESC connection type."]
734pub enum EscConnectionType {
735 #[doc = "Traditional PPM ESC."]
736 ESC_CONNECTION_TYPE_PPM = 0,
737 #[doc = "Serial Bus connected ESC."]
738 ESC_CONNECTION_TYPE_SERIAL = 1,
739 #[doc = "One Shot PPM ESC."]
740 ESC_CONNECTION_TYPE_ONESHOT = 2,
741 #[doc = "I2C ESC."]
742 ESC_CONNECTION_TYPE_I2C = 3,
743 #[doc = "CAN-Bus ESC."]
744 ESC_CONNECTION_TYPE_CAN = 4,
745 #[doc = "DShot ESC."]
746 ESC_CONNECTION_TYPE_DSHOT = 5,
747}
748impl EscConnectionType {
749 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
750}
751impl Default for EscConnectionType {
752 fn default() -> Self {
753 Self::DEFAULT
754 }
755}
756bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
757impl EscFailureFlags {
758 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
759}
760impl Default for EscFailureFlags {
761 fn default() -> Self {
762 Self::DEFAULT
763 }
764}
765bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
766impl EstimatorStatusFlags {
767 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
768}
769impl Default for EstimatorStatusFlags {
770 fn default() -> Self {
771 Self::DEFAULT
772 }
773}
774#[cfg_attr(feature = "ts", derive(TS))]
775#[cfg_attr(feature = "ts", ts(export))]
776#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
778#[cfg_attr(feature = "serde", serde(tag = "type"))]
779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
780#[repr(u32)]
781#[doc = "List of possible failure type to inject."]
782pub enum FailureType {
783 #[doc = "No failure injected, used to reset a previous failure."]
784 FAILURE_TYPE_OK = 0,
785 #[doc = "Sets unit off, so completely non-responsive."]
786 FAILURE_TYPE_OFF = 1,
787 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
788 FAILURE_TYPE_STUCK = 2,
789 #[doc = "Unit is reporting complete garbage."]
790 FAILURE_TYPE_GARBAGE = 3,
791 #[doc = "Unit is consistently wrong."]
792 FAILURE_TYPE_WRONG = 4,
793 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
794 FAILURE_TYPE_SLOW = 5,
795 #[doc = "Data of unit is delayed in time."]
796 FAILURE_TYPE_DELAYED = 6,
797 #[doc = "Unit is sometimes working, sometimes not."]
798 FAILURE_TYPE_INTERMITTENT = 7,
799}
800impl FailureType {
801 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
802}
803impl Default for FailureType {
804 fn default() -> Self {
805 Self::DEFAULT
806 }
807}
808#[cfg_attr(feature = "ts", derive(TS))]
809#[cfg_attr(feature = "ts", ts(export))]
810#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
812#[cfg_attr(feature = "serde", serde(tag = "type"))]
813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
814#[repr(u32)]
815#[doc = "List of possible units where failures can be injected."]
816pub enum FailureUnit {
817 FAILURE_UNIT_SENSOR_GYRO = 0,
818 FAILURE_UNIT_SENSOR_ACCEL = 1,
819 FAILURE_UNIT_SENSOR_MAG = 2,
820 FAILURE_UNIT_SENSOR_BARO = 3,
821 FAILURE_UNIT_SENSOR_GPS = 4,
822 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
823 FAILURE_UNIT_SENSOR_VIO = 6,
824 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
825 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
826 FAILURE_UNIT_SYSTEM_BATTERY = 100,
827 FAILURE_UNIT_SYSTEM_MOTOR = 101,
828 FAILURE_UNIT_SYSTEM_SERVO = 102,
829 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
830 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
831 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
832}
833impl FailureUnit {
834 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
835}
836impl Default for FailureUnit {
837 fn default() -> Self {
838 Self::DEFAULT
839 }
840}
841#[cfg_attr(feature = "ts", derive(TS))]
842#[cfg_attr(feature = "ts", ts(export))]
843#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
845#[cfg_attr(feature = "serde", serde(tag = "type"))]
846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
847#[repr(u32)]
848pub enum FenceBreach {
849 #[doc = "No last fence breach"]
850 FENCE_BREACH_NONE = 0,
851 #[doc = "Breached minimum altitude"]
852 FENCE_BREACH_MINALT = 1,
853 #[doc = "Breached maximum altitude"]
854 FENCE_BREACH_MAXALT = 2,
855 #[doc = "Breached fence boundary"]
856 FENCE_BREACH_BOUNDARY = 3,
857}
858impl FenceBreach {
859 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
860}
861impl Default for FenceBreach {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[cfg_attr(feature = "ts", derive(TS))]
867#[cfg_attr(feature = "ts", ts(export))]
868#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
870#[cfg_attr(feature = "serde", serde(tag = "type"))]
871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
872#[repr(u32)]
873#[doc = "Actions being taken to mitigate/prevent fence breach"]
874pub enum FenceMitigate {
875 #[doc = "Unknown"]
876 FENCE_MITIGATE_UNKNOWN = 0,
877 #[doc = "No actions being taken"]
878 FENCE_MITIGATE_NONE = 1,
879 #[doc = "Velocity limiting active to prevent breach"]
880 FENCE_MITIGATE_VEL_LIMIT = 2,
881}
882impl FenceMitigate {
883 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
884}
885impl Default for FenceMitigate {
886 fn default() -> Self {
887 Self::DEFAULT
888 }
889}
890#[cfg_attr(feature = "ts", derive(TS))]
891#[cfg_attr(feature = "ts", ts(export))]
892#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
894#[cfg_attr(feature = "serde", serde(tag = "type"))]
895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
896#[repr(u32)]
897#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
898pub enum FenceType {
899 #[doc = "Maximum altitude fence"]
900 FENCE_TYPE_ALT_MAX = 1,
901 #[doc = "Circle fence"]
902 FENCE_TYPE_CIRCLE = 2,
903 #[doc = "Polygon fence"]
904 FENCE_TYPE_POLYGON = 4,
905 #[doc = "Minimum altitude fence"]
906 FENCE_TYPE_ALT_MIN = 8,
907}
908impl FenceType {
909 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
910}
911impl Default for FenceType {
912 fn default() -> Self {
913 Self::DEFAULT
914 }
915}
916#[cfg_attr(feature = "ts", derive(TS))]
917#[cfg_attr(feature = "ts", ts(export))]
918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
920#[cfg_attr(feature = "serde", serde(tag = "type"))]
921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
922#[repr(u32)]
923#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
924pub enum FirmwareVersionType {
925 #[doc = "development release"]
926 FIRMWARE_VERSION_TYPE_DEV = 0,
927 #[doc = "alpha release"]
928 FIRMWARE_VERSION_TYPE_ALPHA = 64,
929 #[doc = "beta release"]
930 FIRMWARE_VERSION_TYPE_BETA = 128,
931 #[doc = "release candidate"]
932 FIRMWARE_VERSION_TYPE_RC = 192,
933 #[doc = "official stable release"]
934 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
935}
936impl FirmwareVersionType {
937 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
938}
939impl Default for FirmwareVersionType {
940 fn default() -> Self {
941 Self::DEFAULT
942 }
943}
944bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
945impl GimbalDeviceCapFlags {
946 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
947}
948impl Default for GimbalDeviceCapFlags {
949 fn default() -> Self {
950 Self::DEFAULT
951 }
952}
953bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
954impl GimbalDeviceErrorFlags {
955 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
956}
957impl Default for GimbalDeviceErrorFlags {
958 fn default() -> Self {
959 Self::DEFAULT
960 }
961}
962bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
963impl GimbalDeviceFlags {
964 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
965}
966impl Default for GimbalDeviceFlags {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
972impl GimbalManagerCapFlags {
973 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
974}
975impl Default for GimbalManagerCapFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
981impl GimbalManagerFlags {
982 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
983}
984impl Default for GimbalManagerFlags {
985 fn default() -> Self {
986 Self::DEFAULT
987 }
988}
989#[cfg_attr(feature = "ts", derive(TS))]
990#[cfg_attr(feature = "ts", ts(export))]
991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
993#[cfg_attr(feature = "serde", serde(tag = "type"))]
994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
995#[repr(u32)]
996#[doc = "Type of GPS fix"]
997pub enum GpsFixType {
998 #[doc = "No GPS connected"]
999 GPS_FIX_TYPE_NO_GPS = 0,
1000 #[doc = "No position information, GPS is connected"]
1001 GPS_FIX_TYPE_NO_FIX = 1,
1002 #[doc = "2D position"]
1003 GPS_FIX_TYPE_2D_FIX = 2,
1004 #[doc = "3D position"]
1005 GPS_FIX_TYPE_3D_FIX = 3,
1006 #[doc = "DGPS/SBAS aided 3D position"]
1007 GPS_FIX_TYPE_DGPS = 4,
1008 #[doc = "RTK float, 3D position"]
1009 GPS_FIX_TYPE_RTK_FLOAT = 5,
1010 #[doc = "RTK Fixed, 3D position"]
1011 GPS_FIX_TYPE_RTK_FIXED = 6,
1012 #[doc = "Static fixed, typically used for base stations"]
1013 GPS_FIX_TYPE_STATIC = 7,
1014 #[doc = "PPP, 3D position."]
1015 GPS_FIX_TYPE_PPP = 8,
1016}
1017impl GpsFixType {
1018 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1019}
1020impl Default for GpsFixType {
1021 fn default() -> Self {
1022 Self::DEFAULT
1023 }
1024}
1025bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1026impl GpsInputIgnoreFlags {
1027 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1028}
1029impl Default for GpsInputIgnoreFlags {
1030 fn default() -> Self {
1031 Self::DEFAULT
1032 }
1033}
1034#[cfg_attr(feature = "ts", derive(TS))]
1035#[cfg_attr(feature = "ts", ts(export))]
1036#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1038#[cfg_attr(feature = "serde", serde(tag = "type"))]
1039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1040#[repr(u32)]
1041#[doc = "Gripper actions."]
1042pub enum GripperActions {
1043 #[doc = "Gripper release cargo."]
1044 GRIPPER_ACTION_RELEASE = 0,
1045 #[doc = "Gripper grab onto cargo."]
1046 GRIPPER_ACTION_GRAB = 1,
1047}
1048impl GripperActions {
1049 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1050}
1051impl Default for GripperActions {
1052 fn default() -> Self {
1053 Self::DEFAULT
1054 }
1055}
1056bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1057impl HighresImuUpdatedFlags {
1058 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1059}
1060impl Default for HighresImuUpdatedFlags {
1061 fn default() -> Self {
1062 Self::DEFAULT
1063 }
1064}
1065bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1066impl HilActuatorControlsFlags {
1067 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1068}
1069impl Default for HilActuatorControlsFlags {
1070 fn default() -> Self {
1071 Self::DEFAULT
1072 }
1073}
1074bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1075impl HilSensorUpdatedFlags {
1076 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1077}
1078impl Default for HilSensorUpdatedFlags {
1079 fn default() -> Self {
1080 Self::DEFAULT
1081 }
1082}
1083bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1084impl HlFailureFlag {
1085 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1086}
1087impl Default for HlFailureFlag {
1088 fn default() -> Self {
1089 Self::DEFAULT
1090 }
1091}
1092bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1093impl IlluminatorErrorFlags {
1094 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1095}
1096impl Default for IlluminatorErrorFlags {
1097 fn default() -> Self {
1098 Self::DEFAULT
1099 }
1100}
1101#[cfg_attr(feature = "ts", derive(TS))]
1102#[cfg_attr(feature = "ts", ts(export))]
1103#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1105#[cfg_attr(feature = "serde", serde(tag = "type"))]
1106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1107#[repr(u32)]
1108#[doc = "Modes of illuminator"]
1109pub enum IlluminatorMode {
1110 #[doc = "Illuminator mode is not specified/unknown"]
1111 ILLUMINATOR_MODE_UNKNOWN = 0,
1112 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1113 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1114 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1115 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1116}
1117impl IlluminatorMode {
1118 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1119}
1120impl Default for IlluminatorMode {
1121 fn default() -> Self {
1122 Self::DEFAULT
1123 }
1124}
1125#[cfg_attr(feature = "ts", derive(TS))]
1126#[cfg_attr(feature = "ts", ts(export))]
1127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1129#[cfg_attr(feature = "serde", serde(tag = "type"))]
1130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1131#[repr(u32)]
1132#[doc = "Type of landing target"]
1133pub enum LandingTargetType {
1134 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1135 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1136 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1137 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1138 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1139 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1140 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1141 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1142}
1143impl LandingTargetType {
1144 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1145}
1146impl Default for LandingTargetType {
1147 fn default() -> Self {
1148 Self::DEFAULT
1149 }
1150}
1151#[cfg_attr(feature = "ts", derive(TS))]
1152#[cfg_attr(feature = "ts", ts(export))]
1153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1155#[cfg_attr(feature = "serde", serde(tag = "type"))]
1156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1157#[repr(u32)]
1158pub enum MagCalStatus {
1159 MAG_CAL_NOT_STARTED = 0,
1160 MAG_CAL_WAITING_TO_START = 1,
1161 MAG_CAL_RUNNING_STEP_ONE = 2,
1162 MAG_CAL_RUNNING_STEP_TWO = 3,
1163 MAG_CAL_SUCCESS = 4,
1164 MAG_CAL_FAILED = 5,
1165 MAG_CAL_BAD_ORIENTATION = 6,
1166 MAG_CAL_BAD_RADIUS = 7,
1167}
1168impl MagCalStatus {
1169 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1170}
1171impl Default for MagCalStatus {
1172 fn default() -> Self {
1173 Self::DEFAULT
1174 }
1175}
1176#[cfg_attr(feature = "ts", derive(TS))]
1177#[cfg_attr(feature = "ts", ts(export))]
1178#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1180#[cfg_attr(feature = "serde", serde(tag = "type"))]
1181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1182#[repr(u32)]
1183pub enum MavArmAuthDeniedReason {
1184 #[doc = "Not a specific reason"]
1185 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1186 #[doc = "Authorizer will send the error as string to GCS"]
1187 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1188 #[doc = "At least one waypoint have a invalid value"]
1189 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1190 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1191 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1192 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1193 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1194 #[doc = "Weather is not good to fly"]
1195 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1196}
1197impl MavArmAuthDeniedReason {
1198 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1199}
1200impl Default for MavArmAuthDeniedReason {
1201 fn default() -> Self {
1202 Self::DEFAULT
1203 }
1204}
1205#[cfg_attr(feature = "ts", derive(TS))]
1206#[cfg_attr(feature = "ts", ts(export))]
1207#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1209#[cfg_attr(feature = "serde", serde(tag = "type"))]
1210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1211#[repr(u32)]
1212#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1213pub enum MavAutopilot {
1214 #[doc = "Generic autopilot, full support for everything"]
1215 MAV_AUTOPILOT_GENERIC = 0,
1216 #[doc = "Reserved for future use."]
1217 MAV_AUTOPILOT_RESERVED = 1,
1218 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1219 MAV_AUTOPILOT_SLUGS = 2,
1220 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1221 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1222 #[doc = "OpenPilot, <http://openpilot.org>"]
1223 MAV_AUTOPILOT_OPENPILOT = 4,
1224 #[doc = "Generic autopilot only supporting simple waypoints"]
1225 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1226 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1227 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1228 #[doc = "Generic autopilot supporting the full mission command set"]
1229 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1230 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1231 MAV_AUTOPILOT_INVALID = 8,
1232 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1233 MAV_AUTOPILOT_PPZ = 9,
1234 #[doc = "UAV Dev Board"]
1235 MAV_AUTOPILOT_UDB = 10,
1236 #[doc = "FlexiPilot"]
1237 MAV_AUTOPILOT_FP = 11,
1238 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1239 MAV_AUTOPILOT_PX4 = 12,
1240 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1241 MAV_AUTOPILOT_SMACCMPILOT = 13,
1242 #[doc = "AutoQuad -- <http://autoquad.org>"]
1243 MAV_AUTOPILOT_AUTOQUAD = 14,
1244 #[doc = "Armazila -- <http://armazila.com>"]
1245 MAV_AUTOPILOT_ARMAZILA = 15,
1246 #[doc = "Aerob -- <http://aerob.ru>"]
1247 MAV_AUTOPILOT_AEROB = 16,
1248 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1249 MAV_AUTOPILOT_ASLUAV = 17,
1250 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1251 MAV_AUTOPILOT_SMARTAP = 18,
1252 #[doc = "AirRails - <http://uaventure.com>"]
1253 MAV_AUTOPILOT_AIRRAILS = 19,
1254 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1255 MAV_AUTOPILOT_REFLEX = 20,
1256}
1257impl MavAutopilot {
1258 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1259}
1260impl Default for MavAutopilot {
1261 fn default() -> Self {
1262 Self::DEFAULT
1263 }
1264}
1265#[cfg_attr(feature = "ts", derive(TS))]
1266#[cfg_attr(feature = "ts", ts(export))]
1267#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1269#[cfg_attr(feature = "serde", serde(tag = "type"))]
1270#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1271#[repr(u32)]
1272#[doc = "Enumeration for battery charge states."]
1273pub enum MavBatteryChargeState {
1274 #[doc = "Low battery state is not provided"]
1275 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1276 #[doc = "Battery is not in low state. Normal operation."]
1277 MAV_BATTERY_CHARGE_STATE_OK = 1,
1278 #[doc = "Battery state is low, warn and monitor close."]
1279 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1280 #[doc = "Battery state is critical, return or abort immediately."]
1281 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1282 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1283 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1284 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1285 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1286 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1287 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1288 #[doc = "Battery is charging."]
1289 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1290}
1291impl MavBatteryChargeState {
1292 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1293}
1294impl Default for MavBatteryChargeState {
1295 fn default() -> Self {
1296 Self::DEFAULT
1297 }
1298}
1299bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1300impl MavBatteryFault {
1301 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1302}
1303impl Default for MavBatteryFault {
1304 fn default() -> Self {
1305 Self::DEFAULT
1306 }
1307}
1308#[cfg_attr(feature = "ts", derive(TS))]
1309#[cfg_attr(feature = "ts", ts(export))]
1310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1312#[cfg_attr(feature = "serde", serde(tag = "type"))]
1313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1314#[repr(u32)]
1315#[doc = "Enumeration of battery functions"]
1316pub enum MavBatteryFunction {
1317 #[doc = "Battery function is unknown"]
1318 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1319 #[doc = "Battery supports all flight systems"]
1320 MAV_BATTERY_FUNCTION_ALL = 1,
1321 #[doc = "Battery for the propulsion system"]
1322 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1323 #[doc = "Avionics battery"]
1324 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1325 #[doc = "Payload battery"]
1326 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1327}
1328impl MavBatteryFunction {
1329 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1330}
1331impl Default for MavBatteryFunction {
1332 fn default() -> Self {
1333 Self::DEFAULT
1334 }
1335}
1336#[cfg_attr(feature = "ts", derive(TS))]
1337#[cfg_attr(feature = "ts", ts(export))]
1338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1340#[cfg_attr(feature = "serde", serde(tag = "type"))]
1341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1342#[repr(u32)]
1343#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1344pub enum MavBatteryMode {
1345 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1346 MAV_BATTERY_MODE_UNKNOWN = 0,
1347 #[doc = "Battery is auto discharging (towards storage level)."]
1348 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1349 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1350 MAV_BATTERY_MODE_HOT_SWAP = 2,
1351}
1352impl MavBatteryMode {
1353 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1354}
1355impl Default for MavBatteryMode {
1356 fn default() -> Self {
1357 Self::DEFAULT
1358 }
1359}
1360#[cfg_attr(feature = "ts", derive(TS))]
1361#[cfg_attr(feature = "ts", ts(export))]
1362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1364#[cfg_attr(feature = "serde", serde(tag = "type"))]
1365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1366#[repr(u32)]
1367#[doc = "Enumeration of battery types"]
1368pub enum MavBatteryType {
1369 #[doc = "Not specified."]
1370 MAV_BATTERY_TYPE_UNKNOWN = 0,
1371 #[doc = "Lithium polymer battery"]
1372 MAV_BATTERY_TYPE_LIPO = 1,
1373 #[doc = "Lithium-iron-phosphate battery"]
1374 MAV_BATTERY_TYPE_LIFE = 2,
1375 #[doc = "Lithium-ION battery"]
1376 MAV_BATTERY_TYPE_LION = 3,
1377 #[doc = "Nickel metal hydride battery"]
1378 MAV_BATTERY_TYPE_NIMH = 4,
1379}
1380impl MavBatteryType {
1381 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1382}
1383impl Default for MavBatteryType {
1384 fn default() -> Self {
1385 Self::DEFAULT
1386 }
1387}
1388#[cfg_attr(feature = "ts", derive(TS))]
1389#[cfg_attr(feature = "ts", ts(export))]
1390#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1392#[cfg_attr(feature = "serde", serde(tag = "type"))]
1393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1394#[repr(u32)]
1395#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1396pub enum MavCmd {
1397 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1398 MAV_CMD_NAV_WAYPOINT = 16,
1399 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1400 MAV_CMD_NAV_LOITER_UNLIM = 17,
1401 #[doc = "Loiter around this waypoint for X turns"]
1402 MAV_CMD_NAV_LOITER_TURNS = 18,
1403 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1404 MAV_CMD_NAV_LOITER_TIME = 19,
1405 #[doc = "Return to launch location"]
1406 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1407 #[doc = "Land at location."]
1408 MAV_CMD_NAV_LAND = 21,
1409 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1410 MAV_CMD_NAV_TAKEOFF = 22,
1411 #[doc = "Land at local position (local frame only)"]
1412 MAV_CMD_NAV_LAND_LOCAL = 23,
1413 #[doc = "Takeoff from local position (local frame only)"]
1414 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1415 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1416 MAV_CMD_NAV_FOLLOW = 25,
1417 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1418 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1419 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1420 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1421 #[doc = "Begin following a target"]
1422 MAV_CMD_DO_FOLLOW = 32,
1423 #[doc = "Reposition the MAV after a follow target command has been sent"]
1424 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1425 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1426 MAV_CMD_DO_ORBIT = 34,
1427 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1428 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1429 MAV_CMD_NAV_ROI = 80,
1430 #[doc = "Control autonomous path planning on the MAV."]
1431 MAV_CMD_NAV_PATHPLANNING = 81,
1432 #[doc = "Navigate to waypoint using a spline path."]
1433 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1434 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1435 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1436 #[doc = "Land using VTOL mode"]
1437 MAV_CMD_NAV_VTOL_LAND = 85,
1438 #[doc = "hand control over to an external controller"]
1439 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1440 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1441 MAV_CMD_NAV_DELAY = 93,
1442 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1443 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1444 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1445 MAV_CMD_NAV_LAST = 95,
1446 #[doc = "Delay mission state machine."]
1447 MAV_CMD_CONDITION_DELAY = 112,
1448 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1449 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1450 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1451 MAV_CMD_CONDITION_DISTANCE = 114,
1452 #[doc = "Reach a certain target angle."]
1453 MAV_CMD_CONDITION_YAW = 115,
1454 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1455 MAV_CMD_CONDITION_LAST = 159,
1456 #[doc = "Set system mode."]
1457 MAV_CMD_DO_SET_MODE = 176,
1458 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1459 MAV_CMD_DO_JUMP = 177,
1460 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1461 MAV_CMD_DO_CHANGE_SPEED = 178,
1462 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1463 MAV_CMD_DO_SET_HOME = 179,
1464 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1465 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1466 MAV_CMD_DO_SET_PARAMETER = 180,
1467 #[doc = "Set a relay to a condition."]
1468 MAV_CMD_DO_SET_RELAY = 181,
1469 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1470 MAV_CMD_DO_REPEAT_RELAY = 182,
1471 #[doc = "Set a servo to a desired PWM value."]
1472 MAV_CMD_DO_SET_SERVO = 183,
1473 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1474 MAV_CMD_DO_REPEAT_SERVO = 184,
1475 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1476 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1477 #[doc = "Change altitude set point."]
1478 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1479 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1480 MAV_CMD_DO_SET_ACTUATOR = 187,
1481 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1482 MAV_CMD_DO_RETURN_PATH_START = 188,
1483 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1484 MAV_CMD_DO_LAND_START = 189,
1485 #[doc = "Mission command to perform a landing from a rally point."]
1486 MAV_CMD_DO_RALLY_LAND = 190,
1487 #[doc = "Mission command to safely abort an autonomous landing."]
1488 MAV_CMD_DO_GO_AROUND = 191,
1489 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1490 MAV_CMD_DO_REPOSITION = 192,
1491 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1492 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1493 #[doc = "Set moving direction to forward or reverse."]
1494 MAV_CMD_DO_SET_REVERSE = 194,
1495 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1496 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1497 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1498 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1499 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1500 MAV_CMD_DO_SET_ROI_NONE = 197,
1501 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1502 MAV_CMD_DO_SET_ROI_SYSID = 198,
1503 #[doc = "Control onboard camera system."]
1504 MAV_CMD_DO_CONTROL_VIDEO = 200,
1505 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1506 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1507 MAV_CMD_DO_SET_ROI = 201,
1508 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1509 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1510 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1511 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1512 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1513 #[doc = "Mission command to configure a camera or antenna mount"]
1514 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1515 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1516 #[doc = "Mission command to control a camera or antenna mount"]
1517 MAV_CMD_DO_MOUNT_CONTROL = 205,
1518 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1519 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1520 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1521 MAV_CMD_DO_FENCE_ENABLE = 207,
1522 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1523 MAV_CMD_DO_PARACHUTE = 208,
1524 #[doc = "Command to perform motor test."]
1525 MAV_CMD_DO_MOTOR_TEST = 209,
1526 #[doc = "Change to/from inverted flight."]
1527 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1528 #[doc = "Mission command to operate a gripper."]
1529 MAV_CMD_DO_GRIPPER = 211,
1530 #[doc = "Enable/disable autotune."]
1531 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1532 #[doc = "Sets a desired vehicle turn angle and speed change."]
1533 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1534 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1535 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1536 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1537 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1538 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1539 #[doc = "set id of master controller"]
1540 MAV_CMD_DO_GUIDED_MASTER = 221,
1541 #[doc = "Set limits for external control"]
1542 MAV_CMD_DO_GUIDED_LIMITS = 222,
1543 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1544 MAV_CMD_DO_ENGINE_CONTROL = 223,
1545 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1546 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1547 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1548 MAV_CMD_DO_LAST = 240,
1549 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1550 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1551 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1552 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1553 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1554 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1555 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1556 MAV_CMD_PREFLIGHT_STORAGE = 245,
1557 #[doc = "Request the reboot or shutdown of system components."]
1558 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1559 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1560 MAV_CMD_OVERRIDE_GOTO = 252,
1561 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1562 MAV_CMD_OBLIQUE_SURVEY = 260,
1563 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1564 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1565 #[doc = "start running a mission"]
1566 MAV_CMD_MISSION_START = 300,
1567 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1568 MAV_CMD_ACTUATOR_TEST = 310,
1569 #[doc = "Actuator configuration command."]
1570 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1571 #[doc = "Arms / Disarms a component"]
1572 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1573 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1574 MAV_CMD_RUN_PREARM_CHECKS = 401,
1575 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1576 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1577 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1578 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1579 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1580 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1581 MAV_CMD_GET_HOME_POSITION = 410,
1582 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1583 MAV_CMD_INJECT_FAILURE = 420,
1584 #[doc = "Starts receiver pairing."]
1585 MAV_CMD_START_RX_PAIR = 500,
1586 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1587 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1588 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1589 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1590 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1591 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1592 MAV_CMD_REQUEST_MESSAGE = 512,
1593 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1594 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1595 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1596 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1597 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1598 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1599 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1600 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1601 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1602 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1603 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1604 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1605 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1606 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1607 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1608 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1609 MAV_CMD_STORAGE_FORMAT = 526,
1610 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1611 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1612 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1613 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1614 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1615 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1616 #[doc = "Reset all camera settings to Factory Default"]
1617 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1618 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1619 MAV_CMD_SET_CAMERA_MODE = 530,
1620 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1621 MAV_CMD_SET_CAMERA_ZOOM = 531,
1622 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1623 MAV_CMD_SET_CAMERA_FOCUS = 532,
1624 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1625 MAV_CMD_SET_STORAGE_USAGE = 533,
1626 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1627 MAV_CMD_SET_CAMERA_SOURCE = 534,
1628 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1629 MAV_CMD_JUMP_TAG = 600,
1630 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1631 MAV_CMD_DO_JUMP_TAG = 601,
1632 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1633 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1634 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1635 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1636 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1637 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1638 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1639 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1640 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1641 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1642 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1643 #[doc = "Enable or disable on-board camera triggering system."]
1644 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1645 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1646 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1647 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1648 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1649 #[doc = "Stops ongoing tracking."]
1650 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1651 #[doc = "Starts video capture (recording)."]
1652 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1653 #[doc = "Stop the current video capture (recording)."]
1654 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1655 #[doc = "Start video streaming"]
1656 MAV_CMD_VIDEO_START_STREAMING = 2502,
1657 #[doc = "Stop the given video stream"]
1658 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1659 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1660 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1661 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1662 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1663 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1664 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1665 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1666 MAV_CMD_LOGGING_START = 2510,
1667 #[doc = "Request to stop streaming log data over MAVLink"]
1668 MAV_CMD_LOGGING_STOP = 2511,
1669 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1670 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1671 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1672 #[doc = "Create a panorama at the current position"]
1673 MAV_CMD_PANORAMA_CREATE = 2800,
1674 #[doc = "Request VTOL transition"]
1675 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1676 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1677 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1678 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1679 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1680 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1681 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1682 #[doc = "Delay mission state machine until gate has been reached."]
1683 MAV_CMD_CONDITION_GATE = 4501,
1684 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1685 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1686 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1687 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1688 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1689 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1690 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1691 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1692 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1693 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1694 #[doc = "Rally point. You can have multiple rally points defined."]
1695 MAV_CMD_NAV_RALLY_POINT = 5100,
1696 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1697 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1698 #[doc = "Change state of safety switch."]
1699 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1700 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1701 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1702 #[deprecated = " (Deprecated since 2021-06)"]
1703 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1704 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1705 #[deprecated = " (Deprecated since 2021-06)"]
1706 #[doc = "Control the payload deployment."]
1707 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1708 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1709 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1710 #[doc = "Command to operate winch."]
1711 MAV_CMD_DO_WINCH = 42600,
1712 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1713 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1714 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1715 MAV_CMD_WAYPOINT_USER_1 = 31000,
1716 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1717 MAV_CMD_WAYPOINT_USER_2 = 31001,
1718 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1719 MAV_CMD_WAYPOINT_USER_3 = 31002,
1720 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1721 MAV_CMD_WAYPOINT_USER_4 = 31003,
1722 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1723 MAV_CMD_WAYPOINT_USER_5 = 31004,
1724 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1725 MAV_CMD_SPATIAL_USER_1 = 31005,
1726 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1727 MAV_CMD_SPATIAL_USER_2 = 31006,
1728 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1729 MAV_CMD_SPATIAL_USER_3 = 31007,
1730 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1731 MAV_CMD_SPATIAL_USER_4 = 31008,
1732 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1733 MAV_CMD_SPATIAL_USER_5 = 31009,
1734 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1735 MAV_CMD_USER_1 = 31010,
1736 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1737 MAV_CMD_USER_2 = 31011,
1738 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1739 MAV_CMD_USER_3 = 31012,
1740 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1741 MAV_CMD_USER_4 = 31013,
1742 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1743 MAV_CMD_USER_5 = 31014,
1744 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1745 MAV_CMD_CAN_FORWARD = 32000,
1746}
1747impl MavCmd {
1748 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1749}
1750impl Default for MavCmd {
1751 fn default() -> Self {
1752 Self::DEFAULT
1753 }
1754}
1755#[cfg_attr(feature = "ts", derive(TS))]
1756#[cfg_attr(feature = "ts", ts(export))]
1757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1759#[cfg_attr(feature = "serde", serde(tag = "type"))]
1760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1761#[repr(u32)]
1762#[doc = "Possible actions an aircraft can take to avoid a collision."]
1763pub enum MavCollisionAction {
1764 #[doc = "Ignore any potential collisions"]
1765 MAV_COLLISION_ACTION_NONE = 0,
1766 #[doc = "Report potential collision"]
1767 MAV_COLLISION_ACTION_REPORT = 1,
1768 #[doc = "Ascend or Descend to avoid threat"]
1769 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1770 #[doc = "Move horizontally to avoid threat"]
1771 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1772 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1773 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1774 #[doc = "Aircraft to fly directly back to its launch point"]
1775 MAV_COLLISION_ACTION_RTL = 5,
1776 #[doc = "Aircraft to stop in place"]
1777 MAV_COLLISION_ACTION_HOVER = 6,
1778}
1779impl MavCollisionAction {
1780 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1781}
1782impl Default for MavCollisionAction {
1783 fn default() -> Self {
1784 Self::DEFAULT
1785 }
1786}
1787#[cfg_attr(feature = "ts", derive(TS))]
1788#[cfg_attr(feature = "ts", ts(export))]
1789#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1790#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1791#[cfg_attr(feature = "serde", serde(tag = "type"))]
1792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1793#[repr(u32)]
1794#[doc = "Source of information about this collision."]
1795pub enum MavCollisionSrc {
1796 #[doc = "ID field references ADSB_VEHICLE packets"]
1797 MAV_COLLISION_SRC_ADSB = 0,
1798 #[doc = "ID field references MAVLink SRC ID"]
1799 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1800}
1801impl MavCollisionSrc {
1802 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1803}
1804impl Default for MavCollisionSrc {
1805 fn default() -> Self {
1806 Self::DEFAULT
1807 }
1808}
1809#[cfg_attr(feature = "ts", derive(TS))]
1810#[cfg_attr(feature = "ts", ts(export))]
1811#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1813#[cfg_attr(feature = "serde", serde(tag = "type"))]
1814#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1815#[repr(u32)]
1816#[doc = "Aircraft-rated danger from this threat."]
1817pub enum MavCollisionThreatLevel {
1818 #[doc = "Not a threat"]
1819 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1820 #[doc = "Craft is mildly concerned about this threat"]
1821 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1822 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1823 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1824}
1825impl MavCollisionThreatLevel {
1826 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1827}
1828impl Default for MavCollisionThreatLevel {
1829 fn default() -> Self {
1830 Self::DEFAULT
1831 }
1832}
1833#[cfg_attr(feature = "ts", derive(TS))]
1834#[cfg_attr(feature = "ts", ts(export))]
1835#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1837#[cfg_attr(feature = "serde", serde(tag = "type"))]
1838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1839#[repr(u32)]
1840#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1841pub enum MavComponent {
1842 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1843 MAV_COMP_ID_ALL = 0,
1844 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1845 MAV_COMP_ID_AUTOPILOT1 = 1,
1846 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1847 MAV_COMP_ID_USER1 = 25,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER2 = 26,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER3 = 27,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER4 = 28,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER5 = 29,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER6 = 30,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER7 = 31,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER8 = 32,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER9 = 33,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER10 = 34,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER11 = 35,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER12 = 36,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER13 = 37,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER14 = 38,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER15 = 39,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER16 = 40,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER17 = 41,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER18 = 42,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER19 = 43,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER20 = 44,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER21 = 45,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER22 = 46,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER23 = 47,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER24 = 48,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER25 = 49,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER26 = 50,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER27 = 51,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER28 = 52,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER29 = 53,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER30 = 54,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER31 = 55,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER32 = 56,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER33 = 57,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER34 = 58,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER35 = 59,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER36 = 60,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER37 = 61,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER38 = 62,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER39 = 63,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER40 = 64,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER41 = 65,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER42 = 66,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER43 = 67,
1932 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1933 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1934 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1935 MAV_COMP_ID_USER45 = 69,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER46 = 70,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER47 = 71,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER48 = 72,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER49 = 73,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER50 = 74,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER51 = 75,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER52 = 76,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER53 = 77,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER54 = 78,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER55 = 79,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER56 = 80,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER57 = 81,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER58 = 82,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER59 = 83,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER60 = 84,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER61 = 85,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER62 = 86,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER63 = 87,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER64 = 88,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER65 = 89,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER66 = 90,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER67 = 91,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER68 = 92,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER69 = 93,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER70 = 94,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER71 = 95,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER72 = 96,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER73 = 97,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER74 = 98,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER75 = 99,
1996 #[doc = "Camera #1."]
1997 MAV_COMP_ID_CAMERA = 100,
1998 #[doc = "Camera #2."]
1999 MAV_COMP_ID_CAMERA2 = 101,
2000 #[doc = "Camera #3."]
2001 MAV_COMP_ID_CAMERA3 = 102,
2002 #[doc = "Camera #4."]
2003 MAV_COMP_ID_CAMERA4 = 103,
2004 #[doc = "Camera #5."]
2005 MAV_COMP_ID_CAMERA5 = 104,
2006 #[doc = "Camera #6."]
2007 MAV_COMP_ID_CAMERA6 = 105,
2008 #[doc = "Servo #1."]
2009 MAV_COMP_ID_SERVO1 = 140,
2010 #[doc = "Servo #2."]
2011 MAV_COMP_ID_SERVO2 = 141,
2012 #[doc = "Servo #3."]
2013 MAV_COMP_ID_SERVO3 = 142,
2014 #[doc = "Servo #4."]
2015 MAV_COMP_ID_SERVO4 = 143,
2016 #[doc = "Servo #5."]
2017 MAV_COMP_ID_SERVO5 = 144,
2018 #[doc = "Servo #6."]
2019 MAV_COMP_ID_SERVO6 = 145,
2020 #[doc = "Servo #7."]
2021 MAV_COMP_ID_SERVO7 = 146,
2022 #[doc = "Servo #8."]
2023 MAV_COMP_ID_SERVO8 = 147,
2024 #[doc = "Servo #9."]
2025 MAV_COMP_ID_SERVO9 = 148,
2026 #[doc = "Servo #10."]
2027 MAV_COMP_ID_SERVO10 = 149,
2028 #[doc = "Servo #11."]
2029 MAV_COMP_ID_SERVO11 = 150,
2030 #[doc = "Servo #12."]
2031 MAV_COMP_ID_SERVO12 = 151,
2032 #[doc = "Servo #13."]
2033 MAV_COMP_ID_SERVO13 = 152,
2034 #[doc = "Servo #14."]
2035 MAV_COMP_ID_SERVO14 = 153,
2036 #[doc = "Gimbal #1."]
2037 MAV_COMP_ID_GIMBAL = 154,
2038 #[doc = "Logging component."]
2039 MAV_COMP_ID_LOG = 155,
2040 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2041 MAV_COMP_ID_ADSB = 156,
2042 #[doc = "On Screen Display (OSD) devices for video links."]
2043 MAV_COMP_ID_OSD = 157,
2044 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2045 MAV_COMP_ID_PERIPHERAL = 158,
2046 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2047 #[doc = "Gimbal ID for QX1."]
2048 MAV_COMP_ID_QX1_GIMBAL = 159,
2049 #[doc = "FLARM collision alert component."]
2050 MAV_COMP_ID_FLARM = 160,
2051 #[doc = "Parachute component."]
2052 MAV_COMP_ID_PARACHUTE = 161,
2053 #[doc = "Winch component."]
2054 MAV_COMP_ID_WINCH = 169,
2055 #[doc = "Gimbal #2."]
2056 MAV_COMP_ID_GIMBAL2 = 171,
2057 #[doc = "Gimbal #3."]
2058 MAV_COMP_ID_GIMBAL3 = 172,
2059 #[doc = "Gimbal #4"]
2060 MAV_COMP_ID_GIMBAL4 = 173,
2061 #[doc = "Gimbal #5."]
2062 MAV_COMP_ID_GIMBAL5 = 174,
2063 #[doc = "Gimbal #6."]
2064 MAV_COMP_ID_GIMBAL6 = 175,
2065 #[doc = "Battery #1."]
2066 MAV_COMP_ID_BATTERY = 180,
2067 #[doc = "Battery #2."]
2068 MAV_COMP_ID_BATTERY2 = 181,
2069 #[doc = "CAN over MAVLink client."]
2070 MAV_COMP_ID_MAVCAN = 189,
2071 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2072 MAV_COMP_ID_MISSIONPLANNER = 190,
2073 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2074 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2075 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2076 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2077 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2078 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2079 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2080 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2081 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2082 MAV_COMP_ID_PATHPLANNER = 195,
2083 #[doc = "Component that plans a collision free path between two points."]
2084 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2085 #[doc = "Component that provides position estimates using VIO techniques."]
2086 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2087 #[doc = "Component that manages pairing of vehicle and GCS."]
2088 MAV_COMP_ID_PAIRING_MANAGER = 198,
2089 #[doc = "Inertial Measurement Unit (IMU) #1."]
2090 MAV_COMP_ID_IMU = 200,
2091 #[doc = "Inertial Measurement Unit (IMU) #2."]
2092 MAV_COMP_ID_IMU_2 = 201,
2093 #[doc = "Inertial Measurement Unit (IMU) #3."]
2094 MAV_COMP_ID_IMU_3 = 202,
2095 #[doc = "GPS #1."]
2096 MAV_COMP_ID_GPS = 220,
2097 #[doc = "GPS #2."]
2098 MAV_COMP_ID_GPS2 = 221,
2099 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2100 MAV_COMP_ID_ODID_TXRX_1 = 236,
2101 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2102 MAV_COMP_ID_ODID_TXRX_2 = 237,
2103 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2104 MAV_COMP_ID_ODID_TXRX_3 = 238,
2105 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2106 MAV_COMP_ID_UDP_BRIDGE = 240,
2107 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2108 MAV_COMP_ID_UART_BRIDGE = 241,
2109 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2110 MAV_COMP_ID_TUNNEL_NODE = 242,
2111 #[doc = "Illuminator"]
2112 MAV_COMP_ID_ILLUMINATOR = 243,
2113 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2114 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2115 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2116}
2117impl MavComponent {
2118 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2119}
2120impl Default for MavComponent {
2121 fn default() -> Self {
2122 Self::DEFAULT
2123 }
2124}
2125#[cfg_attr(feature = "ts", derive(TS))]
2126#[cfg_attr(feature = "ts", ts(export))]
2127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2129#[cfg_attr(feature = "serde", serde(tag = "type"))]
2130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2131#[repr(u32)]
2132#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2133#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2134pub enum MavDataStream {
2135 #[doc = "Enable all data streams"]
2136 MAV_DATA_STREAM_ALL = 0,
2137 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2138 MAV_DATA_STREAM_RAW_SENSORS = 1,
2139 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2140 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2141 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2142 MAV_DATA_STREAM_RC_CHANNELS = 3,
2143 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2144 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2145 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2146 MAV_DATA_STREAM_POSITION = 6,
2147 #[doc = "Dependent on the autopilot"]
2148 MAV_DATA_STREAM_EXTRA1 = 10,
2149 #[doc = "Dependent on the autopilot"]
2150 MAV_DATA_STREAM_EXTRA2 = 11,
2151 #[doc = "Dependent on the autopilot"]
2152 MAV_DATA_STREAM_EXTRA3 = 12,
2153}
2154impl MavDataStream {
2155 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2156}
2157impl Default for MavDataStream {
2158 fn default() -> Self {
2159 Self::DEFAULT
2160 }
2161}
2162#[cfg_attr(feature = "ts", derive(TS))]
2163#[cfg_attr(feature = "ts", ts(export))]
2164#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2166#[cfg_attr(feature = "serde", serde(tag = "type"))]
2167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2168#[repr(u32)]
2169#[doc = "Enumeration of distance sensor types"]
2170pub enum MavDistanceSensor {
2171 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2172 MAV_DISTANCE_SENSOR_LASER = 0,
2173 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2174 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2175 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2176 MAV_DISTANCE_SENSOR_INFRARED = 2,
2177 #[doc = "Radar type, e.g. uLanding units"]
2178 MAV_DISTANCE_SENSOR_RADAR = 3,
2179 #[doc = "Broken or unknown type, e.g. analog units"]
2180 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2181}
2182impl MavDistanceSensor {
2183 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2184}
2185impl Default for MavDistanceSensor {
2186 fn default() -> Self {
2187 Self::DEFAULT
2188 }
2189}
2190#[cfg_attr(feature = "ts", derive(TS))]
2191#[cfg_attr(feature = "ts", ts(export))]
2192#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2193#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2194#[cfg_attr(feature = "serde", serde(tag = "type"))]
2195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2196#[repr(u32)]
2197#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2198pub enum MavDoRepositionFlags {
2199 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2200 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2201}
2202impl MavDoRepositionFlags {
2203 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2204}
2205impl Default for MavDoRepositionFlags {
2206 fn default() -> Self {
2207 Self::DEFAULT
2208 }
2209}
2210#[cfg_attr(feature = "ts", derive(TS))]
2211#[cfg_attr(feature = "ts", ts(export))]
2212#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2214#[cfg_attr(feature = "serde", serde(tag = "type"))]
2215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2216#[repr(u32)]
2217#[doc = "Enumeration of estimator types"]
2218pub enum MavEstimatorType {
2219 #[doc = "Unknown type of the estimator."]
2220 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2221 #[doc = "This is a naive estimator without any real covariance feedback."]
2222 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2223 #[doc = "Computer vision based estimate. Might be up to scale."]
2224 MAV_ESTIMATOR_TYPE_VISION = 2,
2225 #[doc = "Visual-inertial estimate."]
2226 MAV_ESTIMATOR_TYPE_VIO = 3,
2227 #[doc = "Plain GPS estimate."]
2228 MAV_ESTIMATOR_TYPE_GPS = 4,
2229 #[doc = "Estimator integrating GPS and inertial sensing."]
2230 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2231 #[doc = "Estimate from external motion capturing system."]
2232 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2233 #[doc = "Estimator based on lidar sensor input."]
2234 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2235 #[doc = "Estimator on autopilot."]
2236 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2237}
2238impl MavEstimatorType {
2239 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2240}
2241impl Default for MavEstimatorType {
2242 fn default() -> Self {
2243 Self::DEFAULT
2244 }
2245}
2246#[cfg_attr(feature = "ts", derive(TS))]
2247#[cfg_attr(feature = "ts", ts(export))]
2248#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2250#[cfg_attr(feature = "serde", serde(tag = "type"))]
2251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2252#[repr(u32)]
2253#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2254pub enum MavEventCurrentSequenceFlags {
2255 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2256 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2257}
2258impl MavEventCurrentSequenceFlags {
2259 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2260}
2261impl Default for MavEventCurrentSequenceFlags {
2262 fn default() -> Self {
2263 Self::DEFAULT
2264 }
2265}
2266#[cfg_attr(feature = "ts", derive(TS))]
2267#[cfg_attr(feature = "ts", ts(export))]
2268#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2269#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2270#[cfg_attr(feature = "serde", serde(tag = "type"))]
2271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2272#[repr(u32)]
2273#[doc = "Reason for an event error response."]
2274pub enum MavEventErrorReason {
2275 #[doc = "The requested event is not available (anymore)."]
2276 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2277}
2278impl MavEventErrorReason {
2279 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2280}
2281impl Default for MavEventErrorReason {
2282 fn default() -> Self {
2283 Self::DEFAULT
2284 }
2285}
2286#[cfg_attr(feature = "ts", derive(TS))]
2287#[cfg_attr(feature = "ts", ts(export))]
2288#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2289#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2290#[cfg_attr(feature = "serde", serde(tag = "type"))]
2291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2292#[repr(u32)]
2293#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2294pub enum MavFrame {
2295 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2296 MAV_FRAME_GLOBAL = 0,
2297 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2298 MAV_FRAME_LOCAL_NED = 1,
2299 #[doc = "NOT a coordinate frame, indicates a mission command."]
2300 MAV_FRAME_MISSION = 2,
2301 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2302 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2303 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2304 MAV_FRAME_LOCAL_ENU = 4,
2305 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2306 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2307 MAV_FRAME_GLOBAL_INT = 5,
2308 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2309 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2310 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2311 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2312 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2313 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2314 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2315 MAV_FRAME_BODY_NED = 8,
2316 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2317 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2318 MAV_FRAME_BODY_OFFSET_NED = 9,
2319 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2320 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2321 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2322 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2323 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2324 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2325 MAV_FRAME_BODY_FRD = 12,
2326 #[deprecated = " (Deprecated since 2019-04)"]
2327 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2328 MAV_FRAME_RESERVED_13 = 13,
2329 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2330 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2331 MAV_FRAME_RESERVED_14 = 14,
2332 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2333 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2334 MAV_FRAME_RESERVED_15 = 15,
2335 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2336 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2337 MAV_FRAME_RESERVED_16 = 16,
2338 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2339 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2340 MAV_FRAME_RESERVED_17 = 17,
2341 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2342 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2343 MAV_FRAME_RESERVED_18 = 18,
2344 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2345 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2346 MAV_FRAME_RESERVED_19 = 19,
2347 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2348 MAV_FRAME_LOCAL_FRD = 20,
2349 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2350 MAV_FRAME_LOCAL_FLU = 21,
2351}
2352impl MavFrame {
2353 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2354}
2355impl Default for MavFrame {
2356 fn default() -> Self {
2357 Self::DEFAULT
2358 }
2359}
2360#[cfg_attr(feature = "ts", derive(TS))]
2361#[cfg_attr(feature = "ts", ts(export))]
2362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2364#[cfg_attr(feature = "serde", serde(tag = "type"))]
2365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2366#[repr(u32)]
2367#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2368pub enum MavFtpErr {
2369 #[doc = "None: No error"]
2370 MAV_FTP_ERR_NONE = 0,
2371 #[doc = "Fail: Unknown failure"]
2372 MAV_FTP_ERR_FAIL = 1,
2373 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2374 MAV_FTP_ERR_FAILERRNO = 2,
2375 #[doc = "InvalidDataSize: Payload size is invalid"]
2376 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2377 #[doc = "InvalidSession: Session is not currently open"]
2378 MAV_FTP_ERR_INVALIDSESSION = 4,
2379 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2380 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2381 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2382 MAV_FTP_ERR_EOF = 6,
2383 #[doc = "UnknownCommand: Unknown command / opcode"]
2384 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2385 #[doc = "FileExists: File/directory already exists"]
2386 MAV_FTP_ERR_FILEEXISTS = 8,
2387 #[doc = "FileProtected: File/directory is write protected"]
2388 MAV_FTP_ERR_FILEPROTECTED = 9,
2389 #[doc = "FileNotFound: File/directory not found"]
2390 MAV_FTP_ERR_FILENOTFOUND = 10,
2391}
2392impl MavFtpErr {
2393 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2394}
2395impl Default for MavFtpErr {
2396 fn default() -> Self {
2397 Self::DEFAULT
2398 }
2399}
2400#[cfg_attr(feature = "ts", derive(TS))]
2401#[cfg_attr(feature = "ts", ts(export))]
2402#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2404#[cfg_attr(feature = "serde", serde(tag = "type"))]
2405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2406#[repr(u32)]
2407#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2408pub enum MavFtpOpcode {
2409 #[doc = "None. Ignored, always ACKed"]
2410 MAV_FTP_OPCODE_NONE = 0,
2411 #[doc = "TerminateSession: Terminates open Read session"]
2412 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2413 #[doc = "ResetSessions: Terminates all open read sessions"]
2414 MAV_FTP_OPCODE_RESETSESSION = 2,
2415 #[doc = "ListDirectory. List files and directories in path from offset"]
2416 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2417 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2418 MAV_FTP_OPCODE_OPENFILERO = 4,
2419 #[doc = "ReadFile: Reads size bytes from offset in session"]
2420 MAV_FTP_OPCODE_READFILE = 5,
2421 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2422 MAV_FTP_OPCODE_CREATEFILE = 6,
2423 #[doc = "WriteFile: Writes size bytes to offset in session"]
2424 MAV_FTP_OPCODE_WRITEFILE = 7,
2425 #[doc = "RemoveFile: Remove file at path"]
2426 MAV_FTP_OPCODE_REMOVEFILE = 8,
2427 #[doc = "CreateDirectory: Creates directory at path"]
2428 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2429 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2430 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2431 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2432 MAV_FTP_OPCODE_OPENFILEWO = 11,
2433 #[doc = "TruncateFile: Truncate file at path to offset length"]
2434 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2435 #[doc = "Rename: Rename path1 to path2"]
2436 MAV_FTP_OPCODE_RENAME = 13,
2437 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2438 MAV_FTP_OPCODE_CALCFILECRC = 14,
2439 #[doc = "BurstReadFile: Burst download session file"]
2440 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2441 #[doc = "ACK: ACK response"]
2442 MAV_FTP_OPCODE_ACK = 128,
2443 #[doc = "NAK: NAK response"]
2444 MAV_FTP_OPCODE_NAK = 129,
2445}
2446impl MavFtpOpcode {
2447 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2448}
2449impl Default for MavFtpOpcode {
2450 fn default() -> Self {
2451 Self::DEFAULT
2452 }
2453}
2454#[cfg_attr(feature = "ts", derive(TS))]
2455#[cfg_attr(feature = "ts", ts(export))]
2456#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2458#[cfg_attr(feature = "serde", serde(tag = "type"))]
2459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2460#[repr(u32)]
2461#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2462pub enum MavFuelType {
2463 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2464 MAV_FUEL_TYPE_UNKNOWN = 0,
2465 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2466 MAV_FUEL_TYPE_LIQUID = 1,
2467 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2468 MAV_FUEL_TYPE_GAS = 2,
2469}
2470impl MavFuelType {
2471 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2472}
2473impl Default for MavFuelType {
2474 fn default() -> Self {
2475 Self::DEFAULT
2476 }
2477}
2478bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2479impl MavGeneratorStatusFlag {
2480 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2481}
2482impl Default for MavGeneratorStatusFlag {
2483 fn default() -> Self {
2484 Self::DEFAULT
2485 }
2486}
2487#[cfg_attr(feature = "ts", derive(TS))]
2488#[cfg_attr(feature = "ts", ts(export))]
2489#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2491#[cfg_attr(feature = "serde", serde(tag = "type"))]
2492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2493#[repr(u32)]
2494#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2495pub enum MavGoto {
2496 #[doc = "Hold at the current position."]
2497 MAV_GOTO_DO_HOLD = 0,
2498 #[doc = "Continue with the next item in mission execution."]
2499 MAV_GOTO_DO_CONTINUE = 1,
2500 #[doc = "Hold at the current position of the system"]
2501 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2502 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2503 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2504}
2505impl MavGoto {
2506 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2507}
2508impl Default for MavGoto {
2509 fn default() -> Self {
2510 Self::DEFAULT
2511 }
2512}
2513#[cfg_attr(feature = "ts", derive(TS))]
2514#[cfg_attr(feature = "ts", ts(export))]
2515#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2516#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2517#[cfg_attr(feature = "serde", serde(tag = "type"))]
2518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2519#[repr(u32)]
2520#[doc = "Enumeration of landed detector states"]
2521pub enum MavLandedState {
2522 #[doc = "MAV landed state is unknown"]
2523 MAV_LANDED_STATE_UNDEFINED = 0,
2524 #[doc = "MAV is landed (on ground)"]
2525 MAV_LANDED_STATE_ON_GROUND = 1,
2526 #[doc = "MAV is in air"]
2527 MAV_LANDED_STATE_IN_AIR = 2,
2528 #[doc = "MAV currently taking off"]
2529 MAV_LANDED_STATE_TAKEOFF = 3,
2530 #[doc = "MAV currently landing"]
2531 MAV_LANDED_STATE_LANDING = 4,
2532}
2533impl MavLandedState {
2534 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2535}
2536impl Default for MavLandedState {
2537 fn default() -> Self {
2538 Self::DEFAULT
2539 }
2540}
2541#[cfg_attr(feature = "ts", derive(TS))]
2542#[cfg_attr(feature = "ts", ts(export))]
2543#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2545#[cfg_attr(feature = "serde", serde(tag = "type"))]
2546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2547#[repr(u32)]
2548#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2549pub enum MavMissionResult {
2550 #[doc = "mission accepted OK"]
2551 MAV_MISSION_ACCEPTED = 0,
2552 #[doc = "Generic error / not accepting mission commands at all right now."]
2553 MAV_MISSION_ERROR = 1,
2554 #[doc = "Coordinate frame is not supported."]
2555 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2556 #[doc = "Command is not supported."]
2557 MAV_MISSION_UNSUPPORTED = 3,
2558 #[doc = "Mission items exceed storage space."]
2559 MAV_MISSION_NO_SPACE = 4,
2560 #[doc = "One of the parameters has an invalid value."]
2561 MAV_MISSION_INVALID = 5,
2562 #[doc = "param1 has an invalid value."]
2563 MAV_MISSION_INVALID_PARAM1 = 6,
2564 #[doc = "param2 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM2 = 7,
2566 #[doc = "param3 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM3 = 8,
2568 #[doc = "param4 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM4 = 9,
2570 #[doc = "x / param5 has an invalid value."]
2571 MAV_MISSION_INVALID_PARAM5_X = 10,
2572 #[doc = "y / param6 has an invalid value."]
2573 MAV_MISSION_INVALID_PARAM6_Y = 11,
2574 #[doc = "z / param7 has an invalid value."]
2575 MAV_MISSION_INVALID_PARAM7 = 12,
2576 #[doc = "Mission item received out of sequence"]
2577 MAV_MISSION_INVALID_SEQUENCE = 13,
2578 #[doc = "Not accepting any mission commands from this communication partner."]
2579 MAV_MISSION_DENIED = 14,
2580 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2581 MAV_MISSION_OPERATION_CANCELLED = 15,
2582}
2583impl MavMissionResult {
2584 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2585}
2586impl Default for MavMissionResult {
2587 fn default() -> Self {
2588 Self::DEFAULT
2589 }
2590}
2591#[cfg_attr(feature = "ts", derive(TS))]
2592#[cfg_attr(feature = "ts", ts(export))]
2593#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2595#[cfg_attr(feature = "serde", serde(tag = "type"))]
2596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2597#[repr(u32)]
2598#[doc = "Type of mission items being requested/sent in mission protocol."]
2599pub enum MavMissionType {
2600 #[doc = "Items are mission commands for main mission."]
2601 MAV_MISSION_TYPE_MISSION = 0,
2602 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2603 MAV_MISSION_TYPE_FENCE = 1,
2604 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2605 MAV_MISSION_TYPE_RALLY = 2,
2606 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2607 MAV_MISSION_TYPE_ALL = 255,
2608}
2609impl MavMissionType {
2610 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2611}
2612impl Default for MavMissionType {
2613 fn default() -> Self {
2614 Self::DEFAULT
2615 }
2616}
2617#[cfg_attr(feature = "ts", derive(TS))]
2618#[cfg_attr(feature = "ts", ts(export))]
2619#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2621#[cfg_attr(feature = "serde", serde(tag = "type"))]
2622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2623#[repr(u32)]
2624#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2625pub enum MavMode {
2626 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2627 MAV_MODE_PREFLIGHT = 0,
2628 #[doc = "System is allowed to be active, under assisted RC control."]
2629 MAV_MODE_STABILIZE_DISARMED = 80,
2630 #[doc = "System is allowed to be active, under assisted RC control."]
2631 MAV_MODE_STABILIZE_ARMED = 208,
2632 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2633 MAV_MODE_MANUAL_DISARMED = 64,
2634 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2635 MAV_MODE_MANUAL_ARMED = 192,
2636 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2637 MAV_MODE_GUIDED_DISARMED = 88,
2638 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2639 MAV_MODE_GUIDED_ARMED = 216,
2640 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2641 MAV_MODE_AUTO_DISARMED = 92,
2642 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2643 MAV_MODE_AUTO_ARMED = 220,
2644 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2645 MAV_MODE_TEST_DISARMED = 66,
2646 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2647 MAV_MODE_TEST_ARMED = 194,
2648}
2649impl MavMode {
2650 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2651}
2652impl Default for MavMode {
2653 fn default() -> Self {
2654 Self::DEFAULT
2655 }
2656}
2657bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2658impl MavModeFlag {
2659 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2660}
2661impl Default for MavModeFlag {
2662 fn default() -> Self {
2663 Self::DEFAULT
2664 }
2665}
2666#[cfg_attr(feature = "ts", derive(TS))]
2667#[cfg_attr(feature = "ts", ts(export))]
2668#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2670#[cfg_attr(feature = "serde", serde(tag = "type"))]
2671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2672#[repr(u32)]
2673#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2674pub enum MavModeFlagDecodePosition {
2675 #[doc = "First bit: 10000000"]
2676 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2677 #[doc = "Second bit: 01000000"]
2678 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2679 #[doc = "Third bit: 00100000"]
2680 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2681 #[doc = "Fourth bit: 00010000"]
2682 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2683 #[doc = "Fifth bit: 00001000"]
2684 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2685 #[doc = "Sixth bit: 00000100"]
2686 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2687 #[doc = "Seventh bit: 00000010"]
2688 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2689 #[doc = "Eighth bit: 00000001"]
2690 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2691}
2692impl MavModeFlagDecodePosition {
2693 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2694}
2695impl Default for MavModeFlagDecodePosition {
2696 fn default() -> Self {
2697 Self::DEFAULT
2698 }
2699}
2700bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2701impl MavModeProperty {
2702 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2703}
2704impl Default for MavModeProperty {
2705 fn default() -> Self {
2706 Self::DEFAULT
2707 }
2708}
2709#[cfg_attr(feature = "ts", derive(TS))]
2710#[cfg_attr(feature = "ts", ts(export))]
2711#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2713#[cfg_attr(feature = "serde", serde(tag = "type"))]
2714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2715#[repr(u32)]
2716#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2717#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2718pub enum MavMountMode {
2719 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2720 MAV_MOUNT_MODE_RETRACT = 0,
2721 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2722 MAV_MOUNT_MODE_NEUTRAL = 1,
2723 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2724 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2725 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2726 MAV_MOUNT_MODE_RC_TARGETING = 3,
2727 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2728 MAV_MOUNT_MODE_GPS_POINT = 4,
2729 #[doc = "Gimbal tracks system with specified system ID"]
2730 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2731 #[doc = "Gimbal tracks home position"]
2732 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2733}
2734impl MavMountMode {
2735 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2736}
2737impl Default for MavMountMode {
2738 fn default() -> Self {
2739 Self::DEFAULT
2740 }
2741}
2742#[cfg_attr(feature = "ts", derive(TS))]
2743#[cfg_attr(feature = "ts", ts(export))]
2744#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2745#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2746#[cfg_attr(feature = "serde", serde(tag = "type"))]
2747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2748#[repr(u32)]
2749pub enum MavOdidArmStatus {
2750 #[doc = "Passing arming checks."]
2751 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2752 #[doc = "Generic arming failure, see error string for details."]
2753 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2754}
2755impl MavOdidArmStatus {
2756 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2757}
2758impl Default for MavOdidArmStatus {
2759 fn default() -> Self {
2760 Self::DEFAULT
2761 }
2762}
2763#[cfg_attr(feature = "ts", derive(TS))]
2764#[cfg_attr(feature = "ts", ts(export))]
2765#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2767#[cfg_attr(feature = "serde", serde(tag = "type"))]
2768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2769#[repr(u32)]
2770pub enum MavOdidAuthType {
2771 #[doc = "No authentication type is specified."]
2772 MAV_ODID_AUTH_TYPE_NONE = 0,
2773 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2774 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2775 #[doc = "Signature for the Operator ID."]
2776 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2777 #[doc = "Signature for the entire message set."]
2778 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2779 #[doc = "Authentication is provided by Network Remote ID."]
2780 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2781 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2782 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2783}
2784impl MavOdidAuthType {
2785 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2786}
2787impl Default for MavOdidAuthType {
2788 fn default() -> Self {
2789 Self::DEFAULT
2790 }
2791}
2792#[cfg_attr(feature = "ts", derive(TS))]
2793#[cfg_attr(feature = "ts", ts(export))]
2794#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2796#[cfg_attr(feature = "serde", serde(tag = "type"))]
2797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2798#[repr(u32)]
2799pub enum MavOdidCategoryEu {
2800 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2801 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2802 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2803 MAV_ODID_CATEGORY_EU_OPEN = 1,
2804 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2805 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2806 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2807 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2808}
2809impl MavOdidCategoryEu {
2810 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2811}
2812impl Default for MavOdidCategoryEu {
2813 fn default() -> Self {
2814 Self::DEFAULT
2815 }
2816}
2817#[cfg_attr(feature = "ts", derive(TS))]
2818#[cfg_attr(feature = "ts", ts(export))]
2819#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2821#[cfg_attr(feature = "serde", serde(tag = "type"))]
2822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2823#[repr(u32)]
2824pub enum MavOdidClassEu {
2825 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2826 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2827 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2828 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2829 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2830 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2831 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2832 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2833 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2834 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2835 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2836 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2837 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2838 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2839 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2840 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2841}
2842impl MavOdidClassEu {
2843 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2844}
2845impl Default for MavOdidClassEu {
2846 fn default() -> Self {
2847 Self::DEFAULT
2848 }
2849}
2850#[cfg_attr(feature = "ts", derive(TS))]
2851#[cfg_attr(feature = "ts", ts(export))]
2852#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2853#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2854#[cfg_attr(feature = "serde", serde(tag = "type"))]
2855#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2856#[repr(u32)]
2857pub enum MavOdidClassificationType {
2858 #[doc = "The classification type for the UA is undeclared."]
2859 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2860 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2861 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2862}
2863impl MavOdidClassificationType {
2864 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2865}
2866impl Default for MavOdidClassificationType {
2867 fn default() -> Self {
2868 Self::DEFAULT
2869 }
2870}
2871#[cfg_attr(feature = "ts", derive(TS))]
2872#[cfg_attr(feature = "ts", ts(export))]
2873#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2874#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2875#[cfg_attr(feature = "serde", serde(tag = "type"))]
2876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2877#[repr(u32)]
2878pub enum MavOdidDescType {
2879 #[doc = "Optional free-form text description of the purpose of the flight."]
2880 MAV_ODID_DESC_TYPE_TEXT = 0,
2881 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2882 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2883 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2884 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2885}
2886impl MavOdidDescType {
2887 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2888}
2889impl Default for MavOdidDescType {
2890 fn default() -> Self {
2891 Self::DEFAULT
2892 }
2893}
2894#[cfg_attr(feature = "ts", derive(TS))]
2895#[cfg_attr(feature = "ts", ts(export))]
2896#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2897#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2898#[cfg_attr(feature = "serde", serde(tag = "type"))]
2899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2900#[repr(u32)]
2901pub enum MavOdidHeightRef {
2902 #[doc = "The height field is relative to the take-off location."]
2903 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2904 #[doc = "The height field is relative to ground."]
2905 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2906}
2907impl MavOdidHeightRef {
2908 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2909}
2910impl Default for MavOdidHeightRef {
2911 fn default() -> Self {
2912 Self::DEFAULT
2913 }
2914}
2915#[cfg_attr(feature = "ts", derive(TS))]
2916#[cfg_attr(feature = "ts", ts(export))]
2917#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2919#[cfg_attr(feature = "serde", serde(tag = "type"))]
2920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2921#[repr(u32)]
2922pub enum MavOdidHorAcc {
2923 #[doc = "The horizontal accuracy is unknown."]
2924 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2925 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2926 MAV_ODID_HOR_ACC_10NM = 1,
2927 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2928 MAV_ODID_HOR_ACC_4NM = 2,
2929 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2930 MAV_ODID_HOR_ACC_2NM = 3,
2931 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2932 MAV_ODID_HOR_ACC_1NM = 4,
2933 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2934 MAV_ODID_HOR_ACC_0_5NM = 5,
2935 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2936 MAV_ODID_HOR_ACC_0_3NM = 6,
2937 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2938 MAV_ODID_HOR_ACC_0_1NM = 7,
2939 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2940 MAV_ODID_HOR_ACC_0_05NM = 8,
2941 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2942 MAV_ODID_HOR_ACC_30_METER = 9,
2943 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2944 MAV_ODID_HOR_ACC_10_METER = 10,
2945 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2946 MAV_ODID_HOR_ACC_3_METER = 11,
2947 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2948 MAV_ODID_HOR_ACC_1_METER = 12,
2949}
2950impl MavOdidHorAcc {
2951 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2952}
2953impl Default for MavOdidHorAcc {
2954 fn default() -> Self {
2955 Self::DEFAULT
2956 }
2957}
2958#[cfg_attr(feature = "ts", derive(TS))]
2959#[cfg_attr(feature = "ts", ts(export))]
2960#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2961#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2962#[cfg_attr(feature = "serde", serde(tag = "type"))]
2963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2964#[repr(u32)]
2965pub enum MavOdidIdType {
2966 #[doc = "No type defined."]
2967 MAV_ODID_ID_TYPE_NONE = 0,
2968 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2969 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2970 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2971 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2972 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2973 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2974 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2975 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2976}
2977impl MavOdidIdType {
2978 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2979}
2980impl Default for MavOdidIdType {
2981 fn default() -> Self {
2982 Self::DEFAULT
2983 }
2984}
2985#[cfg_attr(feature = "ts", derive(TS))]
2986#[cfg_attr(feature = "ts", ts(export))]
2987#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2989#[cfg_attr(feature = "serde", serde(tag = "type"))]
2990#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2991#[repr(u32)]
2992pub enum MavOdidOperatorIdType {
2993 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2994 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2995}
2996impl MavOdidOperatorIdType {
2997 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2998}
2999impl Default for MavOdidOperatorIdType {
3000 fn default() -> Self {
3001 Self::DEFAULT
3002 }
3003}
3004#[cfg_attr(feature = "ts", derive(TS))]
3005#[cfg_attr(feature = "ts", ts(export))]
3006#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3008#[cfg_attr(feature = "serde", serde(tag = "type"))]
3009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3010#[repr(u32)]
3011pub enum MavOdidOperatorLocationType {
3012 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3013 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3014 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3015 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3016 #[doc = "The location/altitude of the operator are fixed values."]
3017 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3018}
3019impl MavOdidOperatorLocationType {
3020 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3021}
3022impl Default for MavOdidOperatorLocationType {
3023 fn default() -> Self {
3024 Self::DEFAULT
3025 }
3026}
3027#[cfg_attr(feature = "ts", derive(TS))]
3028#[cfg_attr(feature = "ts", ts(export))]
3029#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3031#[cfg_attr(feature = "serde", serde(tag = "type"))]
3032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3033#[repr(u32)]
3034pub enum MavOdidSpeedAcc {
3035 #[doc = "The speed accuracy is unknown."]
3036 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3037 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3038 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3039 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3040 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3041 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3042 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3043 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3044 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3045}
3046impl MavOdidSpeedAcc {
3047 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3048}
3049impl Default for MavOdidSpeedAcc {
3050 fn default() -> Self {
3051 Self::DEFAULT
3052 }
3053}
3054#[cfg_attr(feature = "ts", derive(TS))]
3055#[cfg_attr(feature = "ts", ts(export))]
3056#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3058#[cfg_attr(feature = "serde", serde(tag = "type"))]
3059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3060#[repr(u32)]
3061pub enum MavOdidStatus {
3062 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3063 MAV_ODID_STATUS_UNDECLARED = 0,
3064 #[doc = "The UA is on the ground."]
3065 MAV_ODID_STATUS_GROUND = 1,
3066 #[doc = "The UA is in the air."]
3067 MAV_ODID_STATUS_AIRBORNE = 2,
3068 #[doc = "The UA is having an emergency."]
3069 MAV_ODID_STATUS_EMERGENCY = 3,
3070 #[doc = "The remote ID system is failing or unreliable in some way."]
3071 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3072}
3073impl MavOdidStatus {
3074 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3075}
3076impl Default for MavOdidStatus {
3077 fn default() -> Self {
3078 Self::DEFAULT
3079 }
3080}
3081#[cfg_attr(feature = "ts", derive(TS))]
3082#[cfg_attr(feature = "ts", ts(export))]
3083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3085#[cfg_attr(feature = "serde", serde(tag = "type"))]
3086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3087#[repr(u32)]
3088pub enum MavOdidTimeAcc {
3089 #[doc = "The timestamp accuracy is unknown."]
3090 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3091 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3092 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3093 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3094 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3095 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3096 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3097 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3098 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3099 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3100 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3101 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3102 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3103 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3104 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3105 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3106 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3107 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3108 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3109 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3110 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3111 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3112 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3113 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3114 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3115 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3116 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3117 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3118 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3119 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3120 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3121}
3122impl MavOdidTimeAcc {
3123 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3124}
3125impl Default for MavOdidTimeAcc {
3126 fn default() -> Self {
3127 Self::DEFAULT
3128 }
3129}
3130#[cfg_attr(feature = "ts", derive(TS))]
3131#[cfg_attr(feature = "ts", ts(export))]
3132#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3134#[cfg_attr(feature = "serde", serde(tag = "type"))]
3135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3136#[repr(u32)]
3137pub enum MavOdidUaType {
3138 #[doc = "No UA (Unmanned Aircraft) type defined."]
3139 MAV_ODID_UA_TYPE_NONE = 0,
3140 #[doc = "Aeroplane/Airplane. Fixed wing."]
3141 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3142 #[doc = "Helicopter or multirotor."]
3143 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3144 #[doc = "Gyroplane."]
3145 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3146 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3147 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3148 #[doc = "Ornithopter."]
3149 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3150 #[doc = "Glider."]
3151 MAV_ODID_UA_TYPE_GLIDER = 6,
3152 #[doc = "Kite."]
3153 MAV_ODID_UA_TYPE_KITE = 7,
3154 #[doc = "Free Balloon."]
3155 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3156 #[doc = "Captive Balloon."]
3157 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3158 #[doc = "Airship. E.g. a blimp."]
3159 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3160 #[doc = "Free Fall/Parachute (unpowered)."]
3161 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3162 #[doc = "Rocket."]
3163 MAV_ODID_UA_TYPE_ROCKET = 12,
3164 #[doc = "Tethered powered aircraft."]
3165 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3166 #[doc = "Ground Obstacle."]
3167 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3168 #[doc = "Other type of aircraft not listed earlier."]
3169 MAV_ODID_UA_TYPE_OTHER = 15,
3170}
3171impl MavOdidUaType {
3172 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3173}
3174impl Default for MavOdidUaType {
3175 fn default() -> Self {
3176 Self::DEFAULT
3177 }
3178}
3179#[cfg_attr(feature = "ts", derive(TS))]
3180#[cfg_attr(feature = "ts", ts(export))]
3181#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3183#[cfg_attr(feature = "serde", serde(tag = "type"))]
3184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3185#[repr(u32)]
3186pub enum MavOdidVerAcc {
3187 #[doc = "The vertical accuracy is unknown."]
3188 MAV_ODID_VER_ACC_UNKNOWN = 0,
3189 #[doc = "The vertical accuracy is smaller than 150 meter."]
3190 MAV_ODID_VER_ACC_150_METER = 1,
3191 #[doc = "The vertical accuracy is smaller than 45 meter."]
3192 MAV_ODID_VER_ACC_45_METER = 2,
3193 #[doc = "The vertical accuracy is smaller than 25 meter."]
3194 MAV_ODID_VER_ACC_25_METER = 3,
3195 #[doc = "The vertical accuracy is smaller than 10 meter."]
3196 MAV_ODID_VER_ACC_10_METER = 4,
3197 #[doc = "The vertical accuracy is smaller than 3 meter."]
3198 MAV_ODID_VER_ACC_3_METER = 5,
3199 #[doc = "The vertical accuracy is smaller than 1 meter."]
3200 MAV_ODID_VER_ACC_1_METER = 6,
3201}
3202impl MavOdidVerAcc {
3203 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3204}
3205impl Default for MavOdidVerAcc {
3206 fn default() -> Self {
3207 Self::DEFAULT
3208 }
3209}
3210#[cfg_attr(feature = "ts", derive(TS))]
3211#[cfg_attr(feature = "ts", ts(export))]
3212#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3214#[cfg_attr(feature = "serde", serde(tag = "type"))]
3215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3216#[repr(u32)]
3217#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3218pub enum MavParamExtType {
3219 #[doc = "8-bit unsigned integer"]
3220 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3221 #[doc = "8-bit signed integer"]
3222 MAV_PARAM_EXT_TYPE_INT8 = 2,
3223 #[doc = "16-bit unsigned integer"]
3224 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3225 #[doc = "16-bit signed integer"]
3226 MAV_PARAM_EXT_TYPE_INT16 = 4,
3227 #[doc = "32-bit unsigned integer"]
3228 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3229 #[doc = "32-bit signed integer"]
3230 MAV_PARAM_EXT_TYPE_INT32 = 6,
3231 #[doc = "64-bit unsigned integer"]
3232 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3233 #[doc = "64-bit signed integer"]
3234 MAV_PARAM_EXT_TYPE_INT64 = 8,
3235 #[doc = "32-bit floating-point"]
3236 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3237 #[doc = "64-bit floating-point"]
3238 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3239 #[doc = "Custom Type"]
3240 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3241}
3242impl MavParamExtType {
3243 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3244}
3245impl Default for MavParamExtType {
3246 fn default() -> Self {
3247 Self::DEFAULT
3248 }
3249}
3250#[cfg_attr(feature = "ts", derive(TS))]
3251#[cfg_attr(feature = "ts", ts(export))]
3252#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3254#[cfg_attr(feature = "serde", serde(tag = "type"))]
3255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3256#[repr(u32)]
3257#[doc = "Specifies the datatype of a MAVLink parameter."]
3258pub enum MavParamType {
3259 #[doc = "8-bit unsigned integer"]
3260 MAV_PARAM_TYPE_UINT8 = 1,
3261 #[doc = "8-bit signed integer"]
3262 MAV_PARAM_TYPE_INT8 = 2,
3263 #[doc = "16-bit unsigned integer"]
3264 MAV_PARAM_TYPE_UINT16 = 3,
3265 #[doc = "16-bit signed integer"]
3266 MAV_PARAM_TYPE_INT16 = 4,
3267 #[doc = "32-bit unsigned integer"]
3268 MAV_PARAM_TYPE_UINT32 = 5,
3269 #[doc = "32-bit signed integer"]
3270 MAV_PARAM_TYPE_INT32 = 6,
3271 #[doc = "64-bit unsigned integer"]
3272 MAV_PARAM_TYPE_UINT64 = 7,
3273 #[doc = "64-bit signed integer"]
3274 MAV_PARAM_TYPE_INT64 = 8,
3275 #[doc = "32-bit floating-point"]
3276 MAV_PARAM_TYPE_REAL32 = 9,
3277 #[doc = "64-bit floating-point"]
3278 MAV_PARAM_TYPE_REAL64 = 10,
3279}
3280impl MavParamType {
3281 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3282}
3283impl Default for MavParamType {
3284 fn default() -> Self {
3285 Self::DEFAULT
3286 }
3287}
3288bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3289impl MavPowerStatus {
3290 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3291}
3292impl Default for MavPowerStatus {
3293 fn default() -> Self {
3294 Self::DEFAULT
3295 }
3296}
3297bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3298impl MavProtocolCapability {
3299 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3300}
3301impl Default for MavProtocolCapability {
3302 fn default() -> Self {
3303 Self::DEFAULT
3304 }
3305}
3306#[cfg_attr(feature = "ts", derive(TS))]
3307#[cfg_attr(feature = "ts", ts(export))]
3308#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3309#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3310#[cfg_attr(feature = "serde", serde(tag = "type"))]
3311#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3312#[repr(u32)]
3313#[doc = "Result from a MAVLink command (MAV_CMD)"]
3314pub enum MavResult {
3315 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3316 MAV_RESULT_ACCEPTED = 0,
3317 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3318 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3319 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3320 MAV_RESULT_DENIED = 2,
3321 #[doc = "Command is not supported (unknown)."]
3322 MAV_RESULT_UNSUPPORTED = 3,
3323 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3324 MAV_RESULT_FAILED = 4,
3325 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3326 MAV_RESULT_IN_PROGRESS = 5,
3327 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3328 MAV_RESULT_CANCELLED = 6,
3329 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3330 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3331 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3332 MAV_RESULT_COMMAND_INT_ONLY = 8,
3333 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3334 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3335}
3336impl MavResult {
3337 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3338}
3339impl Default for MavResult {
3340 fn default() -> Self {
3341 Self::DEFAULT
3342 }
3343}
3344#[cfg_attr(feature = "ts", derive(TS))]
3345#[cfg_attr(feature = "ts", ts(export))]
3346#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3348#[cfg_attr(feature = "serde", serde(tag = "type"))]
3349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3350#[repr(u32)]
3351#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3352#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3353pub enum MavRoi {
3354 #[doc = "No region of interest."]
3355 MAV_ROI_NONE = 0,
3356 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3357 MAV_ROI_WPNEXT = 1,
3358 #[doc = "Point toward given waypoint."]
3359 MAV_ROI_WPINDEX = 2,
3360 #[doc = "Point toward fixed location."]
3361 MAV_ROI_LOCATION = 3,
3362 #[doc = "Point toward of given id."]
3363 MAV_ROI_TARGET = 4,
3364}
3365impl MavRoi {
3366 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3367}
3368impl Default for MavRoi {
3369 fn default() -> Self {
3370 Self::DEFAULT
3371 }
3372}
3373#[cfg_attr(feature = "ts", derive(TS))]
3374#[cfg_attr(feature = "ts", ts(export))]
3375#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3377#[cfg_attr(feature = "serde", serde(tag = "type"))]
3378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3379#[repr(u32)]
3380#[doc = "Enumeration of sensor orientation, according to its rotations"]
3381pub enum MavSensorOrientation {
3382 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3383 MAV_SENSOR_ROTATION_NONE = 0,
3384 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3385 MAV_SENSOR_ROTATION_YAW_45 = 1,
3386 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3387 MAV_SENSOR_ROTATION_YAW_90 = 2,
3388 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3389 MAV_SENSOR_ROTATION_YAW_135 = 3,
3390 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3391 MAV_SENSOR_ROTATION_YAW_180 = 4,
3392 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3393 MAV_SENSOR_ROTATION_YAW_225 = 5,
3394 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3395 MAV_SENSOR_ROTATION_YAW_270 = 6,
3396 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3397 MAV_SENSOR_ROTATION_YAW_315 = 7,
3398 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3399 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3400 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3401 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3402 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3403 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3404 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3405 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3406 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3407 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3408 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3409 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3410 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3411 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3412 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3413 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3414 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3415 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3416 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3417 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3418 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3419 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3420 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3421 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3422 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3423 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3424 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3425 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3426 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3427 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3428 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3429 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3430 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3431 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3432 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3433 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3434 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3435 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3436 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3437 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3438 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3439 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3440 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3441 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3442 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3443 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3444 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3445 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3446 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3447 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3448 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3449 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3450 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3451 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3452 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3453 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3454 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3455 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3456 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3457 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3458 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3459 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3460 #[doc = "Pitch: 315"]
3461 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3462 #[doc = "Roll: 90, Pitch: 315"]
3463 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3464 #[doc = "Custom orientation"]
3465 MAV_SENSOR_ROTATION_CUSTOM = 100,
3466}
3467impl MavSensorOrientation {
3468 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3469}
3470impl Default for MavSensorOrientation {
3471 fn default() -> Self {
3472 Self::DEFAULT
3473 }
3474}
3475#[cfg_attr(feature = "ts", derive(TS))]
3476#[cfg_attr(feature = "ts", ts(export))]
3477#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3479#[cfg_attr(feature = "serde", serde(tag = "type"))]
3480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3481#[repr(u32)]
3482#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3483pub enum MavSeverity {
3484 #[doc = "System is unusable. This is a \"panic\" condition."]
3485 MAV_SEVERITY_EMERGENCY = 0,
3486 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3487 MAV_SEVERITY_ALERT = 1,
3488 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3489 MAV_SEVERITY_CRITICAL = 2,
3490 #[doc = "Indicates an error in secondary/redundant systems."]
3491 MAV_SEVERITY_ERROR = 3,
3492 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3493 MAV_SEVERITY_WARNING = 4,
3494 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3495 MAV_SEVERITY_NOTICE = 5,
3496 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3497 MAV_SEVERITY_INFO = 6,
3498 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3499 MAV_SEVERITY_DEBUG = 7,
3500}
3501impl MavSeverity {
3502 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3503}
3504impl Default for MavSeverity {
3505 fn default() -> Self {
3506 Self::DEFAULT
3507 }
3508}
3509#[cfg_attr(feature = "ts", derive(TS))]
3510#[cfg_attr(feature = "ts", ts(export))]
3511#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3513#[cfg_attr(feature = "serde", serde(tag = "type"))]
3514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3515#[repr(u32)]
3516#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3517pub enum MavStandardMode {
3518 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3519 MAV_STANDARD_MODE_NON_STANDARD = 0,
3520 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3521 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3522 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3523 MAV_STANDARD_MODE_ORBIT = 2,
3524 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3525 MAV_STANDARD_MODE_CRUISE = 3,
3526 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3527 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3528 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3529 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3530 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3531 MAV_STANDARD_MODE_MISSION = 6,
3532 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3533 MAV_STANDARD_MODE_LAND = 7,
3534 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3535 MAV_STANDARD_MODE_TAKEOFF = 8,
3536}
3537impl MavStandardMode {
3538 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3539}
3540impl Default for MavStandardMode {
3541 fn default() -> Self {
3542 Self::DEFAULT
3543 }
3544}
3545#[cfg_attr(feature = "ts", derive(TS))]
3546#[cfg_attr(feature = "ts", ts(export))]
3547#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3549#[cfg_attr(feature = "serde", serde(tag = "type"))]
3550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3551#[repr(u32)]
3552pub enum MavState {
3553 #[doc = "Uninitialized system, state is unknown."]
3554 MAV_STATE_UNINIT = 0,
3555 #[doc = "System is booting up."]
3556 MAV_STATE_BOOT = 1,
3557 #[doc = "System is calibrating and not flight-ready."]
3558 MAV_STATE_CALIBRATING = 2,
3559 #[doc = "System is grounded and on standby. It can be launched any time."]
3560 MAV_STATE_STANDBY = 3,
3561 #[doc = "System is active and might be already airborne. Motors are engaged."]
3562 MAV_STATE_ACTIVE = 4,
3563 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3564 MAV_STATE_CRITICAL = 5,
3565 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3566 MAV_STATE_EMERGENCY = 6,
3567 #[doc = "System just initialized its power-down sequence, will shut down now."]
3568 MAV_STATE_POWEROFF = 7,
3569 #[doc = "System is terminating itself (failsafe or commanded)."]
3570 MAV_STATE_FLIGHT_TERMINATION = 8,
3571}
3572impl MavState {
3573 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3574}
3575impl Default for MavState {
3576 fn default() -> Self {
3577 Self::DEFAULT
3578 }
3579}
3580bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3581impl MavSysStatusSensor {
3582 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3583}
3584impl Default for MavSysStatusSensor {
3585 fn default() -> Self {
3586 Self::DEFAULT
3587 }
3588}
3589bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3590impl MavSysStatusSensorExtended {
3591 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3592}
3593impl Default for MavSysStatusSensorExtended {
3594 fn default() -> Self {
3595 Self::DEFAULT
3596 }
3597}
3598#[cfg_attr(feature = "ts", derive(TS))]
3599#[cfg_attr(feature = "ts", ts(export))]
3600#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3602#[cfg_attr(feature = "serde", serde(tag = "type"))]
3603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3604#[repr(u32)]
3605pub enum MavTunnelPayloadType {
3606 #[doc = "Encoding of payload unknown."]
3607 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3608 #[doc = "Registered for STorM32 gimbal controller."]
3609 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3610 #[doc = "Registered for STorM32 gimbal controller."]
3611 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3612 #[doc = "Registered for STorM32 gimbal controller."]
3613 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3614 #[doc = "Registered for STorM32 gimbal controller."]
3615 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3616 #[doc = "Registered for STorM32 gimbal controller."]
3617 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3618 #[doc = "Registered for STorM32 gimbal controller."]
3619 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3620 #[doc = "Registered for STorM32 gimbal controller."]
3621 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3622 #[doc = "Registered for STorM32 gimbal controller."]
3623 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3624 #[doc = "Registered for STorM32 gimbal controller."]
3625 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3626 #[doc = "Registered for STorM32 gimbal controller."]
3627 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3628 #[doc = "Registered for ModalAI remote OSD protocol."]
3629 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3630 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3631 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3632 #[doc = "Registered for ModalAI vendor use."]
3633 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3634}
3635impl MavTunnelPayloadType {
3636 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3637}
3638impl Default for MavTunnelPayloadType {
3639 fn default() -> Self {
3640 Self::DEFAULT
3641 }
3642}
3643#[cfg_attr(feature = "ts", derive(TS))]
3644#[cfg_attr(feature = "ts", ts(export))]
3645#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3647#[cfg_attr(feature = "serde", serde(tag = "type"))]
3648#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3649#[repr(u32)]
3650#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3651pub enum MavType {
3652 #[doc = "Generic micro air vehicle"]
3653 MAV_TYPE_GENERIC = 0,
3654 #[doc = "Fixed wing aircraft."]
3655 MAV_TYPE_FIXED_WING = 1,
3656 #[doc = "Quadrotor"]
3657 MAV_TYPE_QUADROTOR = 2,
3658 #[doc = "Coaxial helicopter"]
3659 MAV_TYPE_COAXIAL = 3,
3660 #[doc = "Normal helicopter with tail rotor."]
3661 MAV_TYPE_HELICOPTER = 4,
3662 #[doc = "Ground installation"]
3663 MAV_TYPE_ANTENNA_TRACKER = 5,
3664 #[doc = "Operator control unit / ground control station"]
3665 MAV_TYPE_GCS = 6,
3666 #[doc = "Airship, controlled"]
3667 MAV_TYPE_AIRSHIP = 7,
3668 #[doc = "Free balloon, uncontrolled"]
3669 MAV_TYPE_FREE_BALLOON = 8,
3670 #[doc = "Rocket"]
3671 MAV_TYPE_ROCKET = 9,
3672 #[doc = "Ground rover"]
3673 MAV_TYPE_GROUND_ROVER = 10,
3674 #[doc = "Surface vessel, boat, ship"]
3675 MAV_TYPE_SURFACE_BOAT = 11,
3676 #[doc = "Submarine"]
3677 MAV_TYPE_SUBMARINE = 12,
3678 #[doc = "Hexarotor"]
3679 MAV_TYPE_HEXAROTOR = 13,
3680 #[doc = "Octorotor"]
3681 MAV_TYPE_OCTOROTOR = 14,
3682 #[doc = "Tricopter"]
3683 MAV_TYPE_TRICOPTER = 15,
3684 #[doc = "Flapping wing"]
3685 MAV_TYPE_FLAPPING_WING = 16,
3686 #[doc = "Kite"]
3687 MAV_TYPE_KITE = 17,
3688 #[doc = "Onboard companion controller"]
3689 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3690 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3691 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3692 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3693 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3694 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3695 MAV_TYPE_VTOL_TILTROTOR = 21,
3696 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3697 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3698 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3699 MAV_TYPE_VTOL_TAILSITTER = 23,
3700 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3701 MAV_TYPE_VTOL_TILTWING = 24,
3702 #[doc = "VTOL reserved 5"]
3703 MAV_TYPE_VTOL_RESERVED5 = 25,
3704 #[doc = "Gimbal"]
3705 MAV_TYPE_GIMBAL = 26,
3706 #[doc = "ADSB system"]
3707 MAV_TYPE_ADSB = 27,
3708 #[doc = "Steerable, nonrigid airfoil"]
3709 MAV_TYPE_PARAFOIL = 28,
3710 #[doc = "Dodecarotor"]
3711 MAV_TYPE_DODECAROTOR = 29,
3712 #[doc = "Camera"]
3713 MAV_TYPE_CAMERA = 30,
3714 #[doc = "Charging station"]
3715 MAV_TYPE_CHARGING_STATION = 31,
3716 #[doc = "FLARM collision avoidance system"]
3717 MAV_TYPE_FLARM = 32,
3718 #[doc = "Servo"]
3719 MAV_TYPE_SERVO = 33,
3720 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3721 MAV_TYPE_ODID = 34,
3722 #[doc = "Decarotor"]
3723 MAV_TYPE_DECAROTOR = 35,
3724 #[doc = "Battery"]
3725 MAV_TYPE_BATTERY = 36,
3726 #[doc = "Parachute"]
3727 MAV_TYPE_PARACHUTE = 37,
3728 #[doc = "Log"]
3729 MAV_TYPE_LOG = 38,
3730 #[doc = "OSD"]
3731 MAV_TYPE_OSD = 39,
3732 #[doc = "IMU"]
3733 MAV_TYPE_IMU = 40,
3734 #[doc = "GPS"]
3735 MAV_TYPE_GPS = 41,
3736 #[doc = "Winch"]
3737 MAV_TYPE_WINCH = 42,
3738 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3739 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3740 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3741 MAV_TYPE_ILLUMINATOR = 44,
3742 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3743 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3744}
3745impl MavType {
3746 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3747}
3748impl Default for MavType {
3749 fn default() -> Self {
3750 Self::DEFAULT
3751 }
3752}
3753#[cfg_attr(feature = "ts", derive(TS))]
3754#[cfg_attr(feature = "ts", ts(export))]
3755#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3757#[cfg_attr(feature = "serde", serde(tag = "type"))]
3758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3759#[repr(u32)]
3760#[doc = "Enumeration of VTOL states"]
3761pub enum MavVtolState {
3762 #[doc = "MAV is not configured as VTOL"]
3763 MAV_VTOL_STATE_UNDEFINED = 0,
3764 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3765 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3766 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3767 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3768 #[doc = "VTOL is in multicopter state"]
3769 MAV_VTOL_STATE_MC = 3,
3770 #[doc = "VTOL is in fixed-wing state"]
3771 MAV_VTOL_STATE_FW = 4,
3772}
3773impl MavVtolState {
3774 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3775}
3776impl Default for MavVtolState {
3777 fn default() -> Self {
3778 Self::DEFAULT
3779 }
3780}
3781bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3782impl MavWinchStatusFlag {
3783 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3784}
3785impl Default for MavWinchStatusFlag {
3786 fn default() -> Self {
3787 Self::DEFAULT
3788 }
3789}
3790#[cfg_attr(feature = "ts", derive(TS))]
3791#[cfg_attr(feature = "ts", ts(export))]
3792#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3794#[cfg_attr(feature = "serde", serde(tag = "type"))]
3795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3796#[repr(u32)]
3797pub enum MavlinkDataStreamType {
3798 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3799 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3800 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3801 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3802 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3803 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3804}
3805impl MavlinkDataStreamType {
3806 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3807}
3808impl Default for MavlinkDataStreamType {
3809 fn default() -> Self {
3810 Self::DEFAULT
3811 }
3812}
3813#[cfg_attr(feature = "ts", derive(TS))]
3814#[cfg_attr(feature = "ts", ts(export))]
3815#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3816#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3817#[cfg_attr(feature = "serde", serde(tag = "type"))]
3818#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3819#[repr(u32)]
3820#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3821pub enum MissionState {
3822 #[doc = "The mission status reporting is not supported."]
3823 MISSION_STATE_UNKNOWN = 0,
3824 #[doc = "No mission on the vehicle."]
3825 MISSION_STATE_NO_MISSION = 1,
3826 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3827 MISSION_STATE_NOT_STARTED = 2,
3828 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3829 MISSION_STATE_ACTIVE = 3,
3830 #[doc = "Mission is paused when in auto mode."]
3831 MISSION_STATE_PAUSED = 4,
3832 #[doc = "Mission has executed all mission items."]
3833 MISSION_STATE_COMPLETE = 5,
3834}
3835impl MissionState {
3836 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3837}
3838impl Default for MissionState {
3839 fn default() -> Self {
3840 Self::DEFAULT
3841 }
3842}
3843#[cfg_attr(feature = "ts", derive(TS))]
3844#[cfg_attr(feature = "ts", ts(export))]
3845#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3847#[cfg_attr(feature = "serde", serde(tag = "type"))]
3848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3849#[repr(u32)]
3850#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3851pub enum MotorTestOrder {
3852 #[doc = "Default autopilot motor test method."]
3853 MOTOR_TEST_ORDER_DEFAULT = 0,
3854 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3855 MOTOR_TEST_ORDER_SEQUENCE = 1,
3856 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3857 MOTOR_TEST_ORDER_BOARD = 2,
3858}
3859impl MotorTestOrder {
3860 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3861}
3862impl Default for MotorTestOrder {
3863 fn default() -> Self {
3864 Self::DEFAULT
3865 }
3866}
3867#[cfg_attr(feature = "ts", derive(TS))]
3868#[cfg_attr(feature = "ts", ts(export))]
3869#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3871#[cfg_attr(feature = "serde", serde(tag = "type"))]
3872#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3873#[repr(u32)]
3874#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3875pub enum MotorTestThrottleType {
3876 #[doc = "Throttle as a percentage (0 ~ 100)"]
3877 MOTOR_TEST_THROTTLE_PERCENT = 0,
3878 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3879 MOTOR_TEST_THROTTLE_PWM = 1,
3880 #[doc = "Throttle pass-through from pilot's transmitter."]
3881 MOTOR_TEST_THROTTLE_PILOT = 2,
3882 #[doc = "Per-motor compass calibration test."]
3883 MOTOR_TEST_COMPASS_CAL = 3,
3884}
3885impl MotorTestThrottleType {
3886 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3887}
3888impl Default for MotorTestThrottleType {
3889 fn default() -> Self {
3890 Self::DEFAULT
3891 }
3892}
3893#[cfg_attr(feature = "ts", derive(TS))]
3894#[cfg_attr(feature = "ts", ts(export))]
3895#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3896#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3897#[cfg_attr(feature = "serde", serde(tag = "type"))]
3898#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3899#[repr(u32)]
3900pub enum NavVtolLandOptions {
3901 #[doc = "Default autopilot landing behaviour."]
3902 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3903 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3904 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3905 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3906 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3907}
3908impl NavVtolLandOptions {
3909 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3910}
3911impl Default for NavVtolLandOptions {
3912 fn default() -> Self {
3913 Self::DEFAULT
3914 }
3915}
3916#[cfg_attr(feature = "ts", derive(TS))]
3917#[cfg_attr(feature = "ts", ts(export))]
3918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3920#[cfg_attr(feature = "serde", serde(tag = "type"))]
3921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3922#[repr(u32)]
3923#[doc = "Yaw behaviour during orbit flight."]
3924pub enum OrbitYawBehaviour {
3925 #[doc = "Vehicle front points to the center (default)."]
3926 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3927 #[doc = "Vehicle front holds heading when message received."]
3928 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3929 #[doc = "Yaw uncontrolled."]
3930 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3931 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3932 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3933 #[doc = "Yaw controlled by RC input."]
3934 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3935 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3936 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3937}
3938impl OrbitYawBehaviour {
3939 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3940}
3941impl Default for OrbitYawBehaviour {
3942 fn default() -> Self {
3943 Self::DEFAULT
3944 }
3945}
3946#[cfg_attr(feature = "ts", derive(TS))]
3947#[cfg_attr(feature = "ts", ts(export))]
3948#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3950#[cfg_attr(feature = "serde", serde(tag = "type"))]
3951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3952#[repr(u32)]
3953#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3954pub enum ParachuteAction {
3955 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3956 PARACHUTE_DISABLE = 0,
3957 #[doc = "Enable auto-release of parachute."]
3958 PARACHUTE_ENABLE = 1,
3959 #[doc = "Release parachute and kill motors."]
3960 PARACHUTE_RELEASE = 2,
3961}
3962impl ParachuteAction {
3963 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3964}
3965impl Default for ParachuteAction {
3966 fn default() -> Self {
3967 Self::DEFAULT
3968 }
3969}
3970#[cfg_attr(feature = "ts", derive(TS))]
3971#[cfg_attr(feature = "ts", ts(export))]
3972#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3973#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3974#[cfg_attr(feature = "serde", serde(tag = "type"))]
3975#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3976#[repr(u32)]
3977#[doc = "Result from PARAM_EXT_SET message."]
3978pub enum ParamAck {
3979 #[doc = "Parameter value ACCEPTED and SET"]
3980 PARAM_ACK_ACCEPTED = 0,
3981 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3982 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3983 #[doc = "Parameter failed to set"]
3984 PARAM_ACK_FAILED = 2,
3985 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3986 PARAM_ACK_IN_PROGRESS = 3,
3987}
3988impl ParamAck {
3989 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3990}
3991impl Default for ParamAck {
3992 fn default() -> Self {
3993 Self::DEFAULT
3994 }
3995}
3996bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3997impl PositionTargetTypemask {
3998 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3999}
4000impl Default for PositionTargetTypemask {
4001 fn default() -> Self {
4002 Self::DEFAULT
4003 }
4004}
4005#[cfg_attr(feature = "ts", derive(TS))]
4006#[cfg_attr(feature = "ts", ts(export))]
4007#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4008#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4009#[cfg_attr(feature = "serde", serde(tag = "type"))]
4010#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4011#[repr(u32)]
4012#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4013pub enum PrecisionLandMode {
4014 #[doc = "Normal (non-precision) landing."]
4015 PRECISION_LAND_MODE_DISABLED = 0,
4016 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4017 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4018 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4019 PRECISION_LAND_MODE_REQUIRED = 2,
4020}
4021impl PrecisionLandMode {
4022 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4023}
4024impl Default for PrecisionLandMode {
4025 fn default() -> Self {
4026 Self::DEFAULT
4027 }
4028}
4029#[cfg_attr(feature = "ts", derive(TS))]
4030#[cfg_attr(feature = "ts", ts(export))]
4031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4033#[cfg_attr(feature = "serde", serde(tag = "type"))]
4034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4035#[repr(u32)]
4036#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4037pub enum PreflightStorageMissionAction {
4038 #[doc = "Read current mission data from persistent storage"]
4039 MISSION_READ_PERSISTENT = 0,
4040 #[doc = "Write current mission data to persistent storage"]
4041 MISSION_WRITE_PERSISTENT = 1,
4042 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4043 MISSION_RESET_DEFAULT = 2,
4044}
4045impl PreflightStorageMissionAction {
4046 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4047}
4048impl Default for PreflightStorageMissionAction {
4049 fn default() -> Self {
4050 Self::DEFAULT
4051 }
4052}
4053#[cfg_attr(feature = "ts", derive(TS))]
4054#[cfg_attr(feature = "ts", ts(export))]
4055#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4056#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4057#[cfg_attr(feature = "serde", serde(tag = "type"))]
4058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4059#[repr(u32)]
4060#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4061pub enum PreflightStorageParameterAction {
4062 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4063 PARAM_READ_PERSISTENT = 0,
4064 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4065 PARAM_WRITE_PERSISTENT = 1,
4066 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4067 PARAM_RESET_CONFIG_DEFAULT = 2,
4068 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4069 PARAM_RESET_SENSOR_DEFAULT = 3,
4070 #[doc = "Reset all parameters, including operation counters, to default values"]
4071 PARAM_RESET_ALL_DEFAULT = 4,
4072}
4073impl PreflightStorageParameterAction {
4074 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4075}
4076impl Default for PreflightStorageParameterAction {
4077 fn default() -> Self {
4078 Self::DEFAULT
4079 }
4080}
4081#[cfg_attr(feature = "ts", derive(TS))]
4082#[cfg_attr(feature = "ts", ts(export))]
4083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4085#[cfg_attr(feature = "serde", serde(tag = "type"))]
4086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4087#[repr(u32)]
4088#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4089pub enum RcSubType {
4090 #[doc = "Spektrum DSM2"]
4091 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4092 #[doc = "Spektrum DSMX"]
4093 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4094 #[doc = "Spektrum DSMX8"]
4095 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4096}
4097impl RcSubType {
4098 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4099}
4100impl Default for RcSubType {
4101 fn default() -> Self {
4102 Self::DEFAULT
4103 }
4104}
4105#[cfg_attr(feature = "ts", derive(TS))]
4106#[cfg_attr(feature = "ts", ts(export))]
4107#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4108#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4109#[cfg_attr(feature = "serde", serde(tag = "type"))]
4110#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4111#[repr(u32)]
4112#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4113pub enum RcType {
4114 #[doc = "Spektrum"]
4115 RC_TYPE_SPEKTRUM = 0,
4116 #[doc = "CRSF"]
4117 RC_TYPE_CRSF = 1,
4118}
4119impl RcType {
4120 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4121}
4122impl Default for RcType {
4123 fn default() -> Self {
4124 Self::DEFAULT
4125 }
4126}
4127#[cfg_attr(feature = "ts", derive(TS))]
4128#[cfg_attr(feature = "ts", ts(export))]
4129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4131#[cfg_attr(feature = "serde", serde(tag = "type"))]
4132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4133#[repr(u32)]
4134#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4135pub enum RebootShutdownConditions {
4136 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4137 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4138 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4139 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4140}
4141impl RebootShutdownConditions {
4142 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4143}
4144impl Default for RebootShutdownConditions {
4145 fn default() -> Self {
4146 Self::DEFAULT
4147 }
4148}
4149#[cfg_attr(feature = "ts", derive(TS))]
4150#[cfg_attr(feature = "ts", ts(export))]
4151#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4153#[cfg_attr(feature = "serde", serde(tag = "type"))]
4154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4155#[repr(u32)]
4156#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4157pub enum RtkBaselineCoordinateSystem {
4158 #[doc = "Earth-centered, Earth-fixed"]
4159 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4160 #[doc = "RTK basestation centered, north, east, down"]
4161 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4162}
4163impl RtkBaselineCoordinateSystem {
4164 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4165}
4166impl Default for RtkBaselineCoordinateSystem {
4167 fn default() -> Self {
4168 Self::DEFAULT
4169 }
4170}
4171#[cfg_attr(feature = "ts", derive(TS))]
4172#[cfg_attr(feature = "ts", ts(export))]
4173#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4175#[cfg_attr(feature = "serde", serde(tag = "type"))]
4176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4177#[repr(u32)]
4178#[doc = "Possible safety switch states."]
4179pub enum SafetySwitchState {
4180 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4181 SAFETY_SWITCH_STATE_SAFE = 0,
4182 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4183 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4184}
4185impl SafetySwitchState {
4186 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4187}
4188impl Default for SafetySwitchState {
4189 fn default() -> Self {
4190 Self::DEFAULT
4191 }
4192}
4193#[cfg_attr(feature = "ts", derive(TS))]
4194#[cfg_attr(feature = "ts", ts(export))]
4195#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4196#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4197#[cfg_attr(feature = "serde", serde(tag = "type"))]
4198#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4199#[repr(u32)]
4200#[doc = "SERIAL_CONTROL device types"]
4201pub enum SerialControlDev {
4202 #[doc = "First telemetry port"]
4203 SERIAL_CONTROL_DEV_TELEM1 = 0,
4204 #[doc = "Second telemetry port"]
4205 SERIAL_CONTROL_DEV_TELEM2 = 1,
4206 #[doc = "First GPS port"]
4207 SERIAL_CONTROL_DEV_GPS1 = 2,
4208 #[doc = "Second GPS port"]
4209 SERIAL_CONTROL_DEV_GPS2 = 3,
4210 #[doc = "system shell"]
4211 SERIAL_CONTROL_DEV_SHELL = 10,
4212 #[doc = "SERIAL0"]
4213 SERIAL_CONTROL_SERIAL0 = 100,
4214 #[doc = "SERIAL1"]
4215 SERIAL_CONTROL_SERIAL1 = 101,
4216 #[doc = "SERIAL2"]
4217 SERIAL_CONTROL_SERIAL2 = 102,
4218 #[doc = "SERIAL3"]
4219 SERIAL_CONTROL_SERIAL3 = 103,
4220 #[doc = "SERIAL4"]
4221 SERIAL_CONTROL_SERIAL4 = 104,
4222 #[doc = "SERIAL5"]
4223 SERIAL_CONTROL_SERIAL5 = 105,
4224 #[doc = "SERIAL6"]
4225 SERIAL_CONTROL_SERIAL6 = 106,
4226 #[doc = "SERIAL7"]
4227 SERIAL_CONTROL_SERIAL7 = 107,
4228 #[doc = "SERIAL8"]
4229 SERIAL_CONTROL_SERIAL8 = 108,
4230 #[doc = "SERIAL9"]
4231 SERIAL_CONTROL_SERIAL9 = 109,
4232}
4233impl SerialControlDev {
4234 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4235}
4236impl Default for SerialControlDev {
4237 fn default() -> Self {
4238 Self::DEFAULT
4239 }
4240}
4241bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4242impl SerialControlFlag {
4243 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4244}
4245impl Default for SerialControlFlag {
4246 fn default() -> Self {
4247 Self::DEFAULT
4248 }
4249}
4250#[cfg_attr(feature = "ts", derive(TS))]
4251#[cfg_attr(feature = "ts", ts(export))]
4252#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4254#[cfg_attr(feature = "serde", serde(tag = "type"))]
4255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4256#[repr(u32)]
4257#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4258pub enum SetFocusType {
4259 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4260 FOCUS_TYPE_STEP = 0,
4261 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4262 FOCUS_TYPE_CONTINUOUS = 1,
4263 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4264 FOCUS_TYPE_RANGE = 2,
4265 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4266 FOCUS_TYPE_METERS = 3,
4267 #[doc = "Focus automatically."]
4268 FOCUS_TYPE_AUTO = 4,
4269 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4270 FOCUS_TYPE_AUTO_SINGLE = 5,
4271 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4272 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4273}
4274impl SetFocusType {
4275 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4276}
4277impl Default for SetFocusType {
4278 fn default() -> Self {
4279 Self::DEFAULT
4280 }
4281}
4282#[cfg_attr(feature = "ts", derive(TS))]
4283#[cfg_attr(feature = "ts", ts(export))]
4284#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4285#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4286#[cfg_attr(feature = "serde", serde(tag = "type"))]
4287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4288#[repr(u32)]
4289#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4290pub enum SpeedType {
4291 #[doc = "Airspeed"]
4292 SPEED_TYPE_AIRSPEED = 0,
4293 #[doc = "Groundspeed"]
4294 SPEED_TYPE_GROUNDSPEED = 1,
4295 #[doc = "Climb speed"]
4296 SPEED_TYPE_CLIMB_SPEED = 2,
4297 #[doc = "Descent speed"]
4298 SPEED_TYPE_DESCENT_SPEED = 3,
4299}
4300impl SpeedType {
4301 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4302}
4303impl Default for SpeedType {
4304 fn default() -> Self {
4305 Self::DEFAULT
4306 }
4307}
4308#[cfg_attr(feature = "ts", derive(TS))]
4309#[cfg_attr(feature = "ts", ts(export))]
4310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4312#[cfg_attr(feature = "serde", serde(tag = "type"))]
4313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4314#[repr(u32)]
4315#[doc = "Flags to indicate the status of camera storage."]
4316pub enum StorageStatus {
4317 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4318 STORAGE_STATUS_EMPTY = 0,
4319 #[doc = "Storage present but unformatted."]
4320 STORAGE_STATUS_UNFORMATTED = 1,
4321 #[doc = "Storage present and ready."]
4322 STORAGE_STATUS_READY = 2,
4323 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4324 STORAGE_STATUS_NOT_SUPPORTED = 3,
4325}
4326impl StorageStatus {
4327 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4328}
4329impl Default for StorageStatus {
4330 fn default() -> Self {
4331 Self::DEFAULT
4332 }
4333}
4334#[cfg_attr(feature = "ts", derive(TS))]
4335#[cfg_attr(feature = "ts", ts(export))]
4336#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4338#[cfg_attr(feature = "serde", serde(tag = "type"))]
4339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4340#[repr(u32)]
4341#[doc = "Flags to indicate the type of storage."]
4342pub enum StorageType {
4343 #[doc = "Storage type is not known."]
4344 STORAGE_TYPE_UNKNOWN = 0,
4345 #[doc = "Storage type is USB device."]
4346 STORAGE_TYPE_USB_STICK = 1,
4347 #[doc = "Storage type is SD card."]
4348 STORAGE_TYPE_SD = 2,
4349 #[doc = "Storage type is microSD card."]
4350 STORAGE_TYPE_MICROSD = 3,
4351 #[doc = "Storage type is CFast."]
4352 STORAGE_TYPE_CF = 4,
4353 #[doc = "Storage type is CFexpress."]
4354 STORAGE_TYPE_CFE = 5,
4355 #[doc = "Storage type is XQD."]
4356 STORAGE_TYPE_XQD = 6,
4357 #[doc = "Storage type is HD mass storage type."]
4358 STORAGE_TYPE_HD = 7,
4359 #[doc = "Storage type is other, not listed type."]
4360 STORAGE_TYPE_OTHER = 254,
4361}
4362impl StorageType {
4363 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4364}
4365impl Default for StorageType {
4366 fn default() -> Self {
4367 Self::DEFAULT
4368 }
4369}
4370bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4371impl StorageUsageFlag {
4372 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4373}
4374impl Default for StorageUsageFlag {
4375 fn default() -> Self {
4376 Self::DEFAULT
4377 }
4378}
4379#[cfg_attr(feature = "ts", derive(TS))]
4380#[cfg_attr(feature = "ts", ts(export))]
4381#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4383#[cfg_attr(feature = "serde", serde(tag = "type"))]
4384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4385#[repr(u32)]
4386#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4387pub enum TuneFormat {
4388 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4389 TUNE_FORMAT_QBASIC1_1 = 1,
4390 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4391 TUNE_FORMAT_MML_MODERN = 2,
4392}
4393impl TuneFormat {
4394 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4395}
4396impl Default for TuneFormat {
4397 fn default() -> Self {
4398 Self::DEFAULT
4399 }
4400}
4401#[cfg_attr(feature = "ts", derive(TS))]
4402#[cfg_attr(feature = "ts", ts(export))]
4403#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4405#[cfg_attr(feature = "serde", serde(tag = "type"))]
4406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4407#[repr(u32)]
4408#[doc = "Available autopilot modes for ualberta uav"]
4409pub enum UalbertaAutopilotMode {
4410 #[doc = "Raw input pulse widts sent to output"]
4411 MODE_MANUAL_DIRECT = 1,
4412 #[doc = "Inputs are normalized using calibration, the converted back to raw pulse widths for output"]
4413 MODE_MANUAL_SCALED = 2,
4414 MODE_AUTO_PID_ATT = 3,
4415 MODE_AUTO_PID_VEL = 4,
4416 MODE_AUTO_PID_POS = 5,
4417}
4418impl UalbertaAutopilotMode {
4419 pub const DEFAULT: Self = Self::MODE_MANUAL_DIRECT;
4420}
4421impl Default for UalbertaAutopilotMode {
4422 fn default() -> Self {
4423 Self::DEFAULT
4424 }
4425}
4426#[cfg_attr(feature = "ts", derive(TS))]
4427#[cfg_attr(feature = "ts", ts(export))]
4428#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4429#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4430#[cfg_attr(feature = "serde", serde(tag = "type"))]
4431#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4432#[repr(u32)]
4433#[doc = "Navigation filter mode"]
4434pub enum UalbertaNavMode {
4435 NAV_AHRS_INIT = 1,
4436 #[doc = "AHRS mode"]
4437 NAV_AHRS = 2,
4438 #[doc = "INS/GPS initialization mode"]
4439 NAV_INS_GPS_INIT = 3,
4440 #[doc = "INS/GPS mode"]
4441 NAV_INS_GPS = 4,
4442}
4443impl UalbertaNavMode {
4444 pub const DEFAULT: Self = Self::NAV_AHRS_INIT;
4445}
4446impl Default for UalbertaNavMode {
4447 fn default() -> Self {
4448 Self::DEFAULT
4449 }
4450}
4451#[cfg_attr(feature = "ts", derive(TS))]
4452#[cfg_attr(feature = "ts", ts(export))]
4453#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4454#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4455#[cfg_attr(feature = "serde", serde(tag = "type"))]
4456#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4457#[repr(u32)]
4458#[doc = "Mode currently commanded by pilot"]
4459pub enum UalbertaPilotMode {
4460 PILOT_MANUAL = 1,
4461 PILOT_AUTO = 2,
4462 #[doc = "Rotomotion mode"]
4463 PILOT_ROTO = 3,
4464}
4465impl UalbertaPilotMode {
4466 pub const DEFAULT: Self = Self::PILOT_MANUAL;
4467}
4468impl Default for UalbertaPilotMode {
4469 fn default() -> Self {
4470 Self::DEFAULT
4471 }
4472}
4473#[cfg_attr(feature = "ts", derive(TS))]
4474#[cfg_attr(feature = "ts", ts(export))]
4475#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4476#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4477#[cfg_attr(feature = "serde", serde(tag = "type"))]
4478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4479#[repr(u32)]
4480#[doc = "Generalized UAVCAN node health"]
4481pub enum UavcanNodeHealth {
4482 #[doc = "The node is functioning properly."]
4483 UAVCAN_NODE_HEALTH_OK = 0,
4484 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4485 UAVCAN_NODE_HEALTH_WARNING = 1,
4486 #[doc = "The node has encountered a major failure."]
4487 UAVCAN_NODE_HEALTH_ERROR = 2,
4488 #[doc = "The node has suffered a fatal malfunction."]
4489 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4490}
4491impl UavcanNodeHealth {
4492 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4493}
4494impl Default for UavcanNodeHealth {
4495 fn default() -> Self {
4496 Self::DEFAULT
4497 }
4498}
4499#[cfg_attr(feature = "ts", derive(TS))]
4500#[cfg_attr(feature = "ts", ts(export))]
4501#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4502#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4503#[cfg_attr(feature = "serde", serde(tag = "type"))]
4504#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4505#[repr(u32)]
4506#[doc = "Generalized UAVCAN node mode"]
4507pub enum UavcanNodeMode {
4508 #[doc = "The node is performing its primary functions."]
4509 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4510 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4511 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4512 #[doc = "The node is under maintenance."]
4513 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4514 #[doc = "The node is in the process of updating its software."]
4515 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4516 #[doc = "The node is no longer available online."]
4517 UAVCAN_NODE_MODE_OFFLINE = 7,
4518}
4519impl UavcanNodeMode {
4520 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4521}
4522impl Default for UavcanNodeMode {
4523 fn default() -> Self {
4524 Self::DEFAULT
4525 }
4526}
4527bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4528impl UtmDataAvailFlags {
4529 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4530}
4531impl Default for UtmDataAvailFlags {
4532 fn default() -> Self {
4533 Self::DEFAULT
4534 }
4535}
4536#[cfg_attr(feature = "ts", derive(TS))]
4537#[cfg_attr(feature = "ts", ts(export))]
4538#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4540#[cfg_attr(feature = "serde", serde(tag = "type"))]
4541#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4542#[repr(u32)]
4543#[doc = "Airborne status of UAS."]
4544pub enum UtmFlightState {
4545 #[doc = "The flight state can't be determined."]
4546 UTM_FLIGHT_STATE_UNKNOWN = 1,
4547 #[doc = "UAS on ground."]
4548 UTM_FLIGHT_STATE_GROUND = 2,
4549 #[doc = "UAS airborne."]
4550 UTM_FLIGHT_STATE_AIRBORNE = 3,
4551 #[doc = "UAS is in an emergency flight state."]
4552 UTM_FLIGHT_STATE_EMERGENCY = 16,
4553 #[doc = "UAS has no active controls."]
4554 UTM_FLIGHT_STATE_NOCTRL = 32,
4555}
4556impl UtmFlightState {
4557 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4558}
4559impl Default for UtmFlightState {
4560 fn default() -> Self {
4561 Self::DEFAULT
4562 }
4563}
4564#[cfg_attr(feature = "ts", derive(TS))]
4565#[cfg_attr(feature = "ts", ts(export))]
4566#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4567#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4568#[cfg_attr(feature = "serde", serde(tag = "type"))]
4569#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4570#[repr(u32)]
4571#[doc = "Video stream encodings"]
4572pub enum VideoStreamEncoding {
4573 #[doc = "Stream encoding is unknown"]
4574 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4575 #[doc = "Stream encoding is H.264"]
4576 VIDEO_STREAM_ENCODING_H264 = 1,
4577 #[doc = "Stream encoding is H.265"]
4578 VIDEO_STREAM_ENCODING_H265 = 2,
4579}
4580impl VideoStreamEncoding {
4581 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4582}
4583impl Default for VideoStreamEncoding {
4584 fn default() -> Self {
4585 Self::DEFAULT
4586 }
4587}
4588bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4589impl VideoStreamStatusFlags {
4590 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4591}
4592impl Default for VideoStreamStatusFlags {
4593 fn default() -> Self {
4594 Self::DEFAULT
4595 }
4596}
4597#[cfg_attr(feature = "ts", derive(TS))]
4598#[cfg_attr(feature = "ts", ts(export))]
4599#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4600#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4601#[cfg_attr(feature = "serde", serde(tag = "type"))]
4602#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4603#[repr(u32)]
4604#[doc = "Video stream types"]
4605pub enum VideoStreamType {
4606 #[doc = "Stream is RTSP"]
4607 VIDEO_STREAM_TYPE_RTSP = 0,
4608 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4609 VIDEO_STREAM_TYPE_RTPUDP = 1,
4610 #[doc = "Stream is MPEG on TCP"]
4611 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4612 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4613 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4614}
4615impl VideoStreamType {
4616 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4617}
4618impl Default for VideoStreamType {
4619 fn default() -> Self {
4620 Self::DEFAULT
4621 }
4622}
4623#[cfg_attr(feature = "ts", derive(TS))]
4624#[cfg_attr(feature = "ts", ts(export))]
4625#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4627#[cfg_attr(feature = "serde", serde(tag = "type"))]
4628#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4629#[repr(u32)]
4630#[doc = "Direction of VTOL transition"]
4631pub enum VtolTransitionHeading {
4632 #[doc = "Respect the heading configuration of the vehicle."]
4633 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4634 #[doc = "Use the heading pointing towards the next waypoint."]
4635 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4636 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4637 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4638 #[doc = "Use the specified heading in parameter 4."]
4639 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4640 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4641 VTOL_TRANSITION_HEADING_ANY = 4,
4642}
4643impl VtolTransitionHeading {
4644 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4645}
4646impl Default for VtolTransitionHeading {
4647 fn default() -> Self {
4648 Self::DEFAULT
4649 }
4650}
4651#[cfg_attr(feature = "ts", derive(TS))]
4652#[cfg_attr(feature = "ts", ts(export))]
4653#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4654#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4655#[cfg_attr(feature = "serde", serde(tag = "type"))]
4656#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4657#[repr(u32)]
4658#[doc = "WiFi Mode."]
4659pub enum WifiConfigApMode {
4660 #[doc = "WiFi mode is undefined."]
4661 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4662 #[doc = "WiFi configured as an access point."]
4663 WIFI_CONFIG_AP_MODE_AP = 1,
4664 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4665 WIFI_CONFIG_AP_MODE_STATION = 2,
4666 #[doc = "WiFi disabled."]
4667 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4668}
4669impl WifiConfigApMode {
4670 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4671}
4672impl Default for WifiConfigApMode {
4673 fn default() -> Self {
4674 Self::DEFAULT
4675 }
4676}
4677#[cfg_attr(feature = "ts", derive(TS))]
4678#[cfg_attr(feature = "ts", ts(export))]
4679#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4681#[cfg_attr(feature = "serde", serde(tag = "type"))]
4682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4683#[repr(u32)]
4684#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4685pub enum WifiConfigApResponse {
4686 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4687 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4688 #[doc = "Changes accepted."]
4689 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4690 #[doc = "Changes rejected."]
4691 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4692 #[doc = "Invalid Mode."]
4693 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4694 #[doc = "Invalid SSID."]
4695 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4696 #[doc = "Invalid Password."]
4697 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4698}
4699impl WifiConfigApResponse {
4700 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4701}
4702impl Default for WifiConfigApResponse {
4703 fn default() -> Self {
4704 Self::DEFAULT
4705 }
4706}
4707#[cfg_attr(feature = "ts", derive(TS))]
4708#[cfg_attr(feature = "ts", ts(export))]
4709#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4711#[cfg_attr(feature = "serde", serde(tag = "type"))]
4712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4713#[repr(u32)]
4714#[doc = "Winch actions."]
4715pub enum WinchActions {
4716 #[doc = "Allow motor to freewheel."]
4717 WINCH_RELAXED = 0,
4718 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4719 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4720 #[doc = "Wind or unwind line at specified rate."]
4721 WINCH_RATE_CONTROL = 2,
4722 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4723 WINCH_LOCK = 3,
4724 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4725 WINCH_DELIVER = 4,
4726 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4727 WINCH_HOLD = 5,
4728 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4729 WINCH_RETRACT = 6,
4730 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4731 WINCH_LOAD_LINE = 7,
4732 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4733 WINCH_ABANDON_LINE = 8,
4734 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4735 WINCH_LOAD_PAYLOAD = 9,
4736}
4737impl WinchActions {
4738 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4739}
4740impl Default for WinchActions {
4741 fn default() -> Self {
4742 Self::DEFAULT
4743 }
4744}
4745#[doc = "Set the vehicle attitude and body angular rates."]
4746#[doc = ""]
4747#[doc = "ID: 140"]
4748#[derive(Debug, Clone, PartialEq)]
4749#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4751#[cfg_attr(feature = "ts", derive(TS))]
4752#[cfg_attr(feature = "ts", ts(export))]
4753pub struct ACTUATOR_CONTROL_TARGET_DATA {
4754 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4755 pub time_usec: u64,
4756 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4757 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4758 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4759 pub controls: [f32; 8],
4760 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4761 pub group_mlx: u8,
4762}
4763impl ACTUATOR_CONTROL_TARGET_DATA {
4764 pub const ENCODED_LEN: usize = 41usize;
4765 pub const DEFAULT: Self = Self {
4766 time_usec: 0_u64,
4767 controls: [0.0_f32; 8usize],
4768 group_mlx: 0_u8,
4769 };
4770 #[cfg(feature = "arbitrary")]
4771 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4772 use arbitrary::{Arbitrary, Unstructured};
4773 let mut buf = [0u8; 1024];
4774 rng.fill_bytes(&mut buf);
4775 let mut unstructured = Unstructured::new(&buf);
4776 Self::arbitrary(&mut unstructured).unwrap_or_default()
4777 }
4778}
4779impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4780 fn default() -> Self {
4781 Self::DEFAULT.clone()
4782 }
4783}
4784impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4785 type Message = MavMessage;
4786 const ID: u32 = 140u32;
4787 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4788 const EXTRA_CRC: u8 = 181u8;
4789 const ENCODED_LEN: usize = 41usize;
4790 fn deser(
4791 _version: MavlinkVersion,
4792 __input: &[u8],
4793 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4794 let avail_len = __input.len();
4795 let mut payload_buf = [0; Self::ENCODED_LEN];
4796 let mut buf = if avail_len < Self::ENCODED_LEN {
4797 payload_buf[0..avail_len].copy_from_slice(__input);
4798 Bytes::new(&payload_buf)
4799 } else {
4800 Bytes::new(__input)
4801 };
4802 let mut __struct = Self::default();
4803 __struct.time_usec = buf.get_u64_le();
4804 for v in &mut __struct.controls {
4805 let val = buf.get_f32_le();
4806 *v = val;
4807 }
4808 __struct.group_mlx = buf.get_u8();
4809 Ok(__struct)
4810 }
4811 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4812 let mut __tmp = BytesMut::new(bytes);
4813 #[allow(clippy::absurd_extreme_comparisons)]
4814 #[allow(unused_comparisons)]
4815 if __tmp.remaining() < Self::ENCODED_LEN {
4816 panic!(
4817 "buffer is too small (need {} bytes, but got {})",
4818 Self::ENCODED_LEN,
4819 __tmp.remaining(),
4820 )
4821 }
4822 __tmp.put_u64_le(self.time_usec);
4823 for val in &self.controls {
4824 __tmp.put_f32_le(*val);
4825 }
4826 __tmp.put_u8(self.group_mlx);
4827 if matches!(version, MavlinkVersion::V2) {
4828 let len = __tmp.len();
4829 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4830 } else {
4831 __tmp.len()
4832 }
4833 }
4834}
4835#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4836#[doc = ""]
4837#[doc = "ID: 375"]
4838#[derive(Debug, Clone, PartialEq)]
4839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4841#[cfg_attr(feature = "ts", derive(TS))]
4842#[cfg_attr(feature = "ts", ts(export))]
4843pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4844 #[doc = "Timestamp (since system boot)."]
4845 pub time_usec: u64,
4846 #[doc = "Active outputs"]
4847 pub active: u32,
4848 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4849 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4850 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4851 pub actuator: [f32; 32],
4852}
4853impl ACTUATOR_OUTPUT_STATUS_DATA {
4854 pub const ENCODED_LEN: usize = 140usize;
4855 pub const DEFAULT: Self = Self {
4856 time_usec: 0_u64,
4857 active: 0_u32,
4858 actuator: [0.0_f32; 32usize],
4859 };
4860 #[cfg(feature = "arbitrary")]
4861 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4862 use arbitrary::{Arbitrary, Unstructured};
4863 let mut buf = [0u8; 1024];
4864 rng.fill_bytes(&mut buf);
4865 let mut unstructured = Unstructured::new(&buf);
4866 Self::arbitrary(&mut unstructured).unwrap_or_default()
4867 }
4868}
4869impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4870 fn default() -> Self {
4871 Self::DEFAULT.clone()
4872 }
4873}
4874impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4875 type Message = MavMessage;
4876 const ID: u32 = 375u32;
4877 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4878 const EXTRA_CRC: u8 = 251u8;
4879 const ENCODED_LEN: usize = 140usize;
4880 fn deser(
4881 _version: MavlinkVersion,
4882 __input: &[u8],
4883 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4884 let avail_len = __input.len();
4885 let mut payload_buf = [0; Self::ENCODED_LEN];
4886 let mut buf = if avail_len < Self::ENCODED_LEN {
4887 payload_buf[0..avail_len].copy_from_slice(__input);
4888 Bytes::new(&payload_buf)
4889 } else {
4890 Bytes::new(__input)
4891 };
4892 let mut __struct = Self::default();
4893 __struct.time_usec = buf.get_u64_le();
4894 __struct.active = buf.get_u32_le();
4895 for v in &mut __struct.actuator {
4896 let val = buf.get_f32_le();
4897 *v = val;
4898 }
4899 Ok(__struct)
4900 }
4901 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4902 let mut __tmp = BytesMut::new(bytes);
4903 #[allow(clippy::absurd_extreme_comparisons)]
4904 #[allow(unused_comparisons)]
4905 if __tmp.remaining() < Self::ENCODED_LEN {
4906 panic!(
4907 "buffer is too small (need {} bytes, but got {})",
4908 Self::ENCODED_LEN,
4909 __tmp.remaining(),
4910 )
4911 }
4912 __tmp.put_u64_le(self.time_usec);
4913 __tmp.put_u32_le(self.active);
4914 for val in &self.actuator {
4915 __tmp.put_f32_le(*val);
4916 }
4917 if matches!(version, MavlinkVersion::V2) {
4918 let len = __tmp.len();
4919 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4920 } else {
4921 __tmp.len()
4922 }
4923 }
4924}
4925#[doc = "The location and information of an ADSB vehicle."]
4926#[doc = ""]
4927#[doc = "ID: 246"]
4928#[derive(Debug, Clone, PartialEq)]
4929#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4930#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4931#[cfg_attr(feature = "ts", derive(TS))]
4932#[cfg_attr(feature = "ts", ts(export))]
4933pub struct ADSB_VEHICLE_DATA {
4934 #[doc = "ICAO address"]
4935 pub ICAO_address: u32,
4936 #[doc = "Latitude"]
4937 pub lat: i32,
4938 #[doc = "Longitude"]
4939 pub lon: i32,
4940 #[doc = "Altitude(ASL)"]
4941 pub altitude: i32,
4942 #[doc = "Course over ground"]
4943 pub heading: u16,
4944 #[doc = "The horizontal velocity"]
4945 pub hor_velocity: u16,
4946 #[doc = "The vertical velocity. Positive is up"]
4947 pub ver_velocity: i16,
4948 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4949 pub flags: AdsbFlags,
4950 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4951 pub squawk: u16,
4952 #[doc = "ADSB altitude type."]
4953 pub altitude_type: AdsbAltitudeType,
4954 #[doc = "The callsign, 8+null"]
4955 #[cfg_attr(
4956 feature = "serde",
4957 serde(
4958 serialize_with = "crate::nulstr::serialize::<_, 9>",
4959 deserialize_with = "crate::nulstr::deserialize::<_, 9>"
4960 )
4961 )]
4962 #[cfg_attr(feature = "ts", ts(type = "string"))]
4963 pub callsign: [u8; 9],
4964 #[doc = "ADSB emitter type."]
4965 pub emitter_type: AdsbEmitterType,
4966 #[doc = "Time since last communication in seconds"]
4967 pub tslc: u8,
4968}
4969impl ADSB_VEHICLE_DATA {
4970 pub const ENCODED_LEN: usize = 38usize;
4971 pub const DEFAULT: Self = Self {
4972 ICAO_address: 0_u32,
4973 lat: 0_i32,
4974 lon: 0_i32,
4975 altitude: 0_i32,
4976 heading: 0_u16,
4977 hor_velocity: 0_u16,
4978 ver_velocity: 0_i16,
4979 flags: AdsbFlags::DEFAULT,
4980 squawk: 0_u16,
4981 altitude_type: AdsbAltitudeType::DEFAULT,
4982 callsign: [0_u8; 9usize],
4983 emitter_type: AdsbEmitterType::DEFAULT,
4984 tslc: 0_u8,
4985 };
4986 #[cfg(feature = "arbitrary")]
4987 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4988 use arbitrary::{Arbitrary, Unstructured};
4989 let mut buf = [0u8; 1024];
4990 rng.fill_bytes(&mut buf);
4991 let mut unstructured = Unstructured::new(&buf);
4992 Self::arbitrary(&mut unstructured).unwrap_or_default()
4993 }
4994}
4995impl Default for ADSB_VEHICLE_DATA {
4996 fn default() -> Self {
4997 Self::DEFAULT.clone()
4998 }
4999}
5000impl MessageData for ADSB_VEHICLE_DATA {
5001 type Message = MavMessage;
5002 const ID: u32 = 246u32;
5003 const NAME: &'static str = "ADSB_VEHICLE";
5004 const EXTRA_CRC: u8 = 184u8;
5005 const ENCODED_LEN: usize = 38usize;
5006 fn deser(
5007 _version: MavlinkVersion,
5008 __input: &[u8],
5009 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5010 let avail_len = __input.len();
5011 let mut payload_buf = [0; Self::ENCODED_LEN];
5012 let mut buf = if avail_len < Self::ENCODED_LEN {
5013 payload_buf[0..avail_len].copy_from_slice(__input);
5014 Bytes::new(&payload_buf)
5015 } else {
5016 Bytes::new(__input)
5017 };
5018 let mut __struct = Self::default();
5019 __struct.ICAO_address = buf.get_u32_le();
5020 __struct.lat = buf.get_i32_le();
5021 __struct.lon = buf.get_i32_le();
5022 __struct.altitude = buf.get_i32_le();
5023 __struct.heading = buf.get_u16_le();
5024 __struct.hor_velocity = buf.get_u16_le();
5025 __struct.ver_velocity = buf.get_i16_le();
5026 let tmp = buf.get_u16_le();
5027 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
5028 ::mavlink_core::error::ParserError::InvalidFlag {
5029 flag_type: "AdsbFlags",
5030 value: tmp as u32,
5031 },
5032 )?;
5033 __struct.squawk = buf.get_u16_le();
5034 let tmp = buf.get_u8();
5035 __struct.altitude_type =
5036 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5037 enum_type: "AdsbAltitudeType",
5038 value: tmp as u32,
5039 })?;
5040 for v in &mut __struct.callsign {
5041 let val = buf.get_u8();
5042 *v = val;
5043 }
5044 let tmp = buf.get_u8();
5045 __struct.emitter_type =
5046 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5047 enum_type: "AdsbEmitterType",
5048 value: tmp as u32,
5049 })?;
5050 __struct.tslc = buf.get_u8();
5051 Ok(__struct)
5052 }
5053 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5054 let mut __tmp = BytesMut::new(bytes);
5055 #[allow(clippy::absurd_extreme_comparisons)]
5056 #[allow(unused_comparisons)]
5057 if __tmp.remaining() < Self::ENCODED_LEN {
5058 panic!(
5059 "buffer is too small (need {} bytes, but got {})",
5060 Self::ENCODED_LEN,
5061 __tmp.remaining(),
5062 )
5063 }
5064 __tmp.put_u32_le(self.ICAO_address);
5065 __tmp.put_i32_le(self.lat);
5066 __tmp.put_i32_le(self.lon);
5067 __tmp.put_i32_le(self.altitude);
5068 __tmp.put_u16_le(self.heading);
5069 __tmp.put_u16_le(self.hor_velocity);
5070 __tmp.put_i16_le(self.ver_velocity);
5071 __tmp.put_u16_le(self.flags.bits());
5072 __tmp.put_u16_le(self.squawk);
5073 __tmp.put_u8(self.altitude_type as u8);
5074 for val in &self.callsign {
5075 __tmp.put_u8(*val);
5076 }
5077 __tmp.put_u8(self.emitter_type as u8);
5078 __tmp.put_u8(self.tslc);
5079 if matches!(version, MavlinkVersion::V2) {
5080 let len = __tmp.len();
5081 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5082 } else {
5083 __tmp.len()
5084 }
5085 }
5086}
5087#[doc = "The location and information of an AIS vessel."]
5088#[doc = ""]
5089#[doc = "ID: 301"]
5090#[derive(Debug, Clone, PartialEq)]
5091#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5093#[cfg_attr(feature = "ts", derive(TS))]
5094#[cfg_attr(feature = "ts", ts(export))]
5095pub struct AIS_VESSEL_DATA {
5096 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5097 pub MMSI: u32,
5098 #[doc = "Latitude"]
5099 pub lat: i32,
5100 #[doc = "Longitude"]
5101 pub lon: i32,
5102 #[doc = "Course over ground"]
5103 pub COG: u16,
5104 #[doc = "True heading"]
5105 pub heading: u16,
5106 #[doc = "Speed over ground"]
5107 pub velocity: u16,
5108 #[doc = "Distance from lat/lon location to bow"]
5109 pub dimension_bow: u16,
5110 #[doc = "Distance from lat/lon location to stern"]
5111 pub dimension_stern: u16,
5112 #[doc = "Time since last communication in seconds"]
5113 pub tslc: u16,
5114 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5115 pub flags: AisFlags,
5116 #[doc = "Turn rate"]
5117 pub turn_rate: i8,
5118 #[doc = "Navigational status"]
5119 pub navigational_status: AisNavStatus,
5120 #[doc = "Type of vessels"]
5121 pub mavtype: AisType,
5122 #[doc = "Distance from lat/lon location to port side"]
5123 pub dimension_port: u8,
5124 #[doc = "Distance from lat/lon location to starboard side"]
5125 pub dimension_starboard: u8,
5126 #[doc = "The vessel callsign"]
5127 #[cfg_attr(
5128 feature = "serde",
5129 serde(
5130 serialize_with = "crate::nulstr::serialize::<_, 7>",
5131 deserialize_with = "crate::nulstr::deserialize::<_, 7>"
5132 )
5133 )]
5134 #[cfg_attr(feature = "ts", ts(type = "string"))]
5135 pub callsign: [u8; 7],
5136 #[doc = "The vessel name"]
5137 #[cfg_attr(
5138 feature = "serde",
5139 serde(
5140 serialize_with = "crate::nulstr::serialize::<_, 20>",
5141 deserialize_with = "crate::nulstr::deserialize::<_, 20>"
5142 )
5143 )]
5144 #[cfg_attr(feature = "ts", ts(type = "string"))]
5145 pub name: [u8; 20],
5146}
5147impl AIS_VESSEL_DATA {
5148 pub const ENCODED_LEN: usize = 58usize;
5149 pub const DEFAULT: Self = Self {
5150 MMSI: 0_u32,
5151 lat: 0_i32,
5152 lon: 0_i32,
5153 COG: 0_u16,
5154 heading: 0_u16,
5155 velocity: 0_u16,
5156 dimension_bow: 0_u16,
5157 dimension_stern: 0_u16,
5158 tslc: 0_u16,
5159 flags: AisFlags::DEFAULT,
5160 turn_rate: 0_i8,
5161 navigational_status: AisNavStatus::DEFAULT,
5162 mavtype: AisType::DEFAULT,
5163 dimension_port: 0_u8,
5164 dimension_starboard: 0_u8,
5165 callsign: [0_u8; 7usize],
5166 name: [0_u8; 20usize],
5167 };
5168 #[cfg(feature = "arbitrary")]
5169 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5170 use arbitrary::{Arbitrary, Unstructured};
5171 let mut buf = [0u8; 1024];
5172 rng.fill_bytes(&mut buf);
5173 let mut unstructured = Unstructured::new(&buf);
5174 Self::arbitrary(&mut unstructured).unwrap_or_default()
5175 }
5176}
5177impl Default for AIS_VESSEL_DATA {
5178 fn default() -> Self {
5179 Self::DEFAULT.clone()
5180 }
5181}
5182impl MessageData for AIS_VESSEL_DATA {
5183 type Message = MavMessage;
5184 const ID: u32 = 301u32;
5185 const NAME: &'static str = "AIS_VESSEL";
5186 const EXTRA_CRC: u8 = 243u8;
5187 const ENCODED_LEN: usize = 58usize;
5188 fn deser(
5189 _version: MavlinkVersion,
5190 __input: &[u8],
5191 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5192 let avail_len = __input.len();
5193 let mut payload_buf = [0; Self::ENCODED_LEN];
5194 let mut buf = if avail_len < Self::ENCODED_LEN {
5195 payload_buf[0..avail_len].copy_from_slice(__input);
5196 Bytes::new(&payload_buf)
5197 } else {
5198 Bytes::new(__input)
5199 };
5200 let mut __struct = Self::default();
5201 __struct.MMSI = buf.get_u32_le();
5202 __struct.lat = buf.get_i32_le();
5203 __struct.lon = buf.get_i32_le();
5204 __struct.COG = buf.get_u16_le();
5205 __struct.heading = buf.get_u16_le();
5206 __struct.velocity = buf.get_u16_le();
5207 __struct.dimension_bow = buf.get_u16_le();
5208 __struct.dimension_stern = buf.get_u16_le();
5209 __struct.tslc = buf.get_u16_le();
5210 let tmp = buf.get_u16_le();
5211 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
5212 ::mavlink_core::error::ParserError::InvalidFlag {
5213 flag_type: "AisFlags",
5214 value: tmp as u32,
5215 },
5216 )?;
5217 __struct.turn_rate = buf.get_i8();
5218 let tmp = buf.get_u8();
5219 __struct.navigational_status =
5220 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5221 enum_type: "AisNavStatus",
5222 value: tmp as u32,
5223 })?;
5224 let tmp = buf.get_u8();
5225 __struct.mavtype =
5226 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5227 enum_type: "AisType",
5228 value: tmp as u32,
5229 })?;
5230 __struct.dimension_port = buf.get_u8();
5231 __struct.dimension_starboard = buf.get_u8();
5232 for v in &mut __struct.callsign {
5233 let val = buf.get_u8();
5234 *v = val;
5235 }
5236 for v in &mut __struct.name {
5237 let val = buf.get_u8();
5238 *v = val;
5239 }
5240 Ok(__struct)
5241 }
5242 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5243 let mut __tmp = BytesMut::new(bytes);
5244 #[allow(clippy::absurd_extreme_comparisons)]
5245 #[allow(unused_comparisons)]
5246 if __tmp.remaining() < Self::ENCODED_LEN {
5247 panic!(
5248 "buffer is too small (need {} bytes, but got {})",
5249 Self::ENCODED_LEN,
5250 __tmp.remaining(),
5251 )
5252 }
5253 __tmp.put_u32_le(self.MMSI);
5254 __tmp.put_i32_le(self.lat);
5255 __tmp.put_i32_le(self.lon);
5256 __tmp.put_u16_le(self.COG);
5257 __tmp.put_u16_le(self.heading);
5258 __tmp.put_u16_le(self.velocity);
5259 __tmp.put_u16_le(self.dimension_bow);
5260 __tmp.put_u16_le(self.dimension_stern);
5261 __tmp.put_u16_le(self.tslc);
5262 __tmp.put_u16_le(self.flags.bits());
5263 __tmp.put_i8(self.turn_rate);
5264 __tmp.put_u8(self.navigational_status as u8);
5265 __tmp.put_u8(self.mavtype as u8);
5266 __tmp.put_u8(self.dimension_port);
5267 __tmp.put_u8(self.dimension_starboard);
5268 for val in &self.callsign {
5269 __tmp.put_u8(*val);
5270 }
5271 for val in &self.name {
5272 __tmp.put_u8(*val);
5273 }
5274 if matches!(version, MavlinkVersion::V2) {
5275 let len = __tmp.len();
5276 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5277 } else {
5278 __tmp.len()
5279 }
5280 }
5281}
5282#[doc = "The current system altitude."]
5283#[doc = ""]
5284#[doc = "ID: 141"]
5285#[derive(Debug, Clone, PartialEq)]
5286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5288#[cfg_attr(feature = "ts", derive(TS))]
5289#[cfg_attr(feature = "ts", ts(export))]
5290pub struct ALTITUDE_DATA {
5291 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5292 pub time_usec: u64,
5293 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5294 pub altitude_monotonic: f32,
5295 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5296 pub altitude_amsl: f32,
5297 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5298 pub altitude_local: f32,
5299 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5300 pub altitude_relative: f32,
5301 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5302 pub altitude_terrain: f32,
5303 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5304 pub bottom_clearance: f32,
5305}
5306impl ALTITUDE_DATA {
5307 pub const ENCODED_LEN: usize = 32usize;
5308 pub const DEFAULT: Self = Self {
5309 time_usec: 0_u64,
5310 altitude_monotonic: 0.0_f32,
5311 altitude_amsl: 0.0_f32,
5312 altitude_local: 0.0_f32,
5313 altitude_relative: 0.0_f32,
5314 altitude_terrain: 0.0_f32,
5315 bottom_clearance: 0.0_f32,
5316 };
5317 #[cfg(feature = "arbitrary")]
5318 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5319 use arbitrary::{Arbitrary, Unstructured};
5320 let mut buf = [0u8; 1024];
5321 rng.fill_bytes(&mut buf);
5322 let mut unstructured = Unstructured::new(&buf);
5323 Self::arbitrary(&mut unstructured).unwrap_or_default()
5324 }
5325}
5326impl Default for ALTITUDE_DATA {
5327 fn default() -> Self {
5328 Self::DEFAULT.clone()
5329 }
5330}
5331impl MessageData for ALTITUDE_DATA {
5332 type Message = MavMessage;
5333 const ID: u32 = 141u32;
5334 const NAME: &'static str = "ALTITUDE";
5335 const EXTRA_CRC: u8 = 47u8;
5336 const ENCODED_LEN: usize = 32usize;
5337 fn deser(
5338 _version: MavlinkVersion,
5339 __input: &[u8],
5340 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5341 let avail_len = __input.len();
5342 let mut payload_buf = [0; Self::ENCODED_LEN];
5343 let mut buf = if avail_len < Self::ENCODED_LEN {
5344 payload_buf[0..avail_len].copy_from_slice(__input);
5345 Bytes::new(&payload_buf)
5346 } else {
5347 Bytes::new(__input)
5348 };
5349 let mut __struct = Self::default();
5350 __struct.time_usec = buf.get_u64_le();
5351 __struct.altitude_monotonic = buf.get_f32_le();
5352 __struct.altitude_amsl = buf.get_f32_le();
5353 __struct.altitude_local = buf.get_f32_le();
5354 __struct.altitude_relative = buf.get_f32_le();
5355 __struct.altitude_terrain = buf.get_f32_le();
5356 __struct.bottom_clearance = buf.get_f32_le();
5357 Ok(__struct)
5358 }
5359 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5360 let mut __tmp = BytesMut::new(bytes);
5361 #[allow(clippy::absurd_extreme_comparisons)]
5362 #[allow(unused_comparisons)]
5363 if __tmp.remaining() < Self::ENCODED_LEN {
5364 panic!(
5365 "buffer is too small (need {} bytes, but got {})",
5366 Self::ENCODED_LEN,
5367 __tmp.remaining(),
5368 )
5369 }
5370 __tmp.put_u64_le(self.time_usec);
5371 __tmp.put_f32_le(self.altitude_monotonic);
5372 __tmp.put_f32_le(self.altitude_amsl);
5373 __tmp.put_f32_le(self.altitude_local);
5374 __tmp.put_f32_le(self.altitude_relative);
5375 __tmp.put_f32_le(self.altitude_terrain);
5376 __tmp.put_f32_le(self.bottom_clearance);
5377 if matches!(version, MavlinkVersion::V2) {
5378 let len = __tmp.len();
5379 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5380 } else {
5381 __tmp.len()
5382 }
5383 }
5384}
5385#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5386#[doc = ""]
5387#[doc = "ID: 30"]
5388#[derive(Debug, Clone, PartialEq)]
5389#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5390#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5391#[cfg_attr(feature = "ts", derive(TS))]
5392#[cfg_attr(feature = "ts", ts(export))]
5393pub struct ATTITUDE_DATA {
5394 #[doc = "Timestamp (time since system boot)."]
5395 pub time_boot_ms: u32,
5396 #[doc = "Roll angle (-pi..+pi)"]
5397 pub roll: f32,
5398 #[doc = "Pitch angle (-pi..+pi)"]
5399 pub pitch: f32,
5400 #[doc = "Yaw angle (-pi..+pi)"]
5401 pub yaw: f32,
5402 #[doc = "Roll angular speed"]
5403 pub rollspeed: f32,
5404 #[doc = "Pitch angular speed"]
5405 pub pitchspeed: f32,
5406 #[doc = "Yaw angular speed"]
5407 pub yawspeed: f32,
5408}
5409impl ATTITUDE_DATA {
5410 pub const ENCODED_LEN: usize = 28usize;
5411 pub const DEFAULT: Self = Self {
5412 time_boot_ms: 0_u32,
5413 roll: 0.0_f32,
5414 pitch: 0.0_f32,
5415 yaw: 0.0_f32,
5416 rollspeed: 0.0_f32,
5417 pitchspeed: 0.0_f32,
5418 yawspeed: 0.0_f32,
5419 };
5420 #[cfg(feature = "arbitrary")]
5421 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5422 use arbitrary::{Arbitrary, Unstructured};
5423 let mut buf = [0u8; 1024];
5424 rng.fill_bytes(&mut buf);
5425 let mut unstructured = Unstructured::new(&buf);
5426 Self::arbitrary(&mut unstructured).unwrap_or_default()
5427 }
5428}
5429impl Default for ATTITUDE_DATA {
5430 fn default() -> Self {
5431 Self::DEFAULT.clone()
5432 }
5433}
5434impl MessageData for ATTITUDE_DATA {
5435 type Message = MavMessage;
5436 const ID: u32 = 30u32;
5437 const NAME: &'static str = "ATTITUDE";
5438 const EXTRA_CRC: u8 = 39u8;
5439 const ENCODED_LEN: usize = 28usize;
5440 fn deser(
5441 _version: MavlinkVersion,
5442 __input: &[u8],
5443 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5444 let avail_len = __input.len();
5445 let mut payload_buf = [0; Self::ENCODED_LEN];
5446 let mut buf = if avail_len < Self::ENCODED_LEN {
5447 payload_buf[0..avail_len].copy_from_slice(__input);
5448 Bytes::new(&payload_buf)
5449 } else {
5450 Bytes::new(__input)
5451 };
5452 let mut __struct = Self::default();
5453 __struct.time_boot_ms = buf.get_u32_le();
5454 __struct.roll = buf.get_f32_le();
5455 __struct.pitch = buf.get_f32_le();
5456 __struct.yaw = buf.get_f32_le();
5457 __struct.rollspeed = buf.get_f32_le();
5458 __struct.pitchspeed = buf.get_f32_le();
5459 __struct.yawspeed = buf.get_f32_le();
5460 Ok(__struct)
5461 }
5462 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5463 let mut __tmp = BytesMut::new(bytes);
5464 #[allow(clippy::absurd_extreme_comparisons)]
5465 #[allow(unused_comparisons)]
5466 if __tmp.remaining() < Self::ENCODED_LEN {
5467 panic!(
5468 "buffer is too small (need {} bytes, but got {})",
5469 Self::ENCODED_LEN,
5470 __tmp.remaining(),
5471 )
5472 }
5473 __tmp.put_u32_le(self.time_boot_ms);
5474 __tmp.put_f32_le(self.roll);
5475 __tmp.put_f32_le(self.pitch);
5476 __tmp.put_f32_le(self.yaw);
5477 __tmp.put_f32_le(self.rollspeed);
5478 __tmp.put_f32_le(self.pitchspeed);
5479 __tmp.put_f32_le(self.yawspeed);
5480 if matches!(version, MavlinkVersion::V2) {
5481 let len = __tmp.len();
5482 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5483 } else {
5484 __tmp.len()
5485 }
5486 }
5487}
5488#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5489#[doc = ""]
5490#[doc = "ID: 31"]
5491#[derive(Debug, Clone, PartialEq)]
5492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5493#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5494#[cfg_attr(feature = "ts", derive(TS))]
5495#[cfg_attr(feature = "ts", ts(export))]
5496pub struct ATTITUDE_QUATERNION_DATA {
5497 #[doc = "Timestamp (time since system boot)."]
5498 pub time_boot_ms: u32,
5499 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5500 pub q1: f32,
5501 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5502 pub q2: f32,
5503 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5504 pub q3: f32,
5505 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5506 pub q4: f32,
5507 #[doc = "Roll angular speed"]
5508 pub rollspeed: f32,
5509 #[doc = "Pitch angular speed"]
5510 pub pitchspeed: f32,
5511 #[doc = "Yaw angular speed"]
5512 pub yawspeed: f32,
5513 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5514 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5515 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5516 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5517 pub repr_offset_q: [f32; 4],
5518}
5519impl ATTITUDE_QUATERNION_DATA {
5520 pub const ENCODED_LEN: usize = 48usize;
5521 pub const DEFAULT: Self = Self {
5522 time_boot_ms: 0_u32,
5523 q1: 0.0_f32,
5524 q2: 0.0_f32,
5525 q3: 0.0_f32,
5526 q4: 0.0_f32,
5527 rollspeed: 0.0_f32,
5528 pitchspeed: 0.0_f32,
5529 yawspeed: 0.0_f32,
5530 repr_offset_q: [0.0_f32; 4usize],
5531 };
5532 #[cfg(feature = "arbitrary")]
5533 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5534 use arbitrary::{Arbitrary, Unstructured};
5535 let mut buf = [0u8; 1024];
5536 rng.fill_bytes(&mut buf);
5537 let mut unstructured = Unstructured::new(&buf);
5538 Self::arbitrary(&mut unstructured).unwrap_or_default()
5539 }
5540}
5541impl Default for ATTITUDE_QUATERNION_DATA {
5542 fn default() -> Self {
5543 Self::DEFAULT.clone()
5544 }
5545}
5546impl MessageData for ATTITUDE_QUATERNION_DATA {
5547 type Message = MavMessage;
5548 const ID: u32 = 31u32;
5549 const NAME: &'static str = "ATTITUDE_QUATERNION";
5550 const EXTRA_CRC: u8 = 246u8;
5551 const ENCODED_LEN: usize = 48usize;
5552 fn deser(
5553 _version: MavlinkVersion,
5554 __input: &[u8],
5555 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5556 let avail_len = __input.len();
5557 let mut payload_buf = [0; Self::ENCODED_LEN];
5558 let mut buf = if avail_len < Self::ENCODED_LEN {
5559 payload_buf[0..avail_len].copy_from_slice(__input);
5560 Bytes::new(&payload_buf)
5561 } else {
5562 Bytes::new(__input)
5563 };
5564 let mut __struct = Self::default();
5565 __struct.time_boot_ms = buf.get_u32_le();
5566 __struct.q1 = buf.get_f32_le();
5567 __struct.q2 = buf.get_f32_le();
5568 __struct.q3 = buf.get_f32_le();
5569 __struct.q4 = buf.get_f32_le();
5570 __struct.rollspeed = buf.get_f32_le();
5571 __struct.pitchspeed = buf.get_f32_le();
5572 __struct.yawspeed = buf.get_f32_le();
5573 for v in &mut __struct.repr_offset_q {
5574 let val = buf.get_f32_le();
5575 *v = val;
5576 }
5577 Ok(__struct)
5578 }
5579 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5580 let mut __tmp = BytesMut::new(bytes);
5581 #[allow(clippy::absurd_extreme_comparisons)]
5582 #[allow(unused_comparisons)]
5583 if __tmp.remaining() < Self::ENCODED_LEN {
5584 panic!(
5585 "buffer is too small (need {} bytes, but got {})",
5586 Self::ENCODED_LEN,
5587 __tmp.remaining(),
5588 )
5589 }
5590 __tmp.put_u32_le(self.time_boot_ms);
5591 __tmp.put_f32_le(self.q1);
5592 __tmp.put_f32_le(self.q2);
5593 __tmp.put_f32_le(self.q3);
5594 __tmp.put_f32_le(self.q4);
5595 __tmp.put_f32_le(self.rollspeed);
5596 __tmp.put_f32_le(self.pitchspeed);
5597 __tmp.put_f32_le(self.yawspeed);
5598 if matches!(version, MavlinkVersion::V2) {
5599 for val in &self.repr_offset_q {
5600 __tmp.put_f32_le(*val);
5601 }
5602 let len = __tmp.len();
5603 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5604 } else {
5605 __tmp.len()
5606 }
5607 }
5608}
5609#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5610#[doc = ""]
5611#[doc = "ID: 61"]
5612#[derive(Debug, Clone, PartialEq)]
5613#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5614#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5615#[cfg_attr(feature = "ts", derive(TS))]
5616#[cfg_attr(feature = "ts", ts(export))]
5617pub struct ATTITUDE_QUATERNION_COV_DATA {
5618 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5619 pub time_usec: u64,
5620 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5621 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5622 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5623 pub q: [f32; 4],
5624 #[doc = "Roll angular speed"]
5625 pub rollspeed: f32,
5626 #[doc = "Pitch angular speed"]
5627 pub pitchspeed: f32,
5628 #[doc = "Yaw angular speed"]
5629 pub yawspeed: f32,
5630 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5631 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5632 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5633 pub covariance: [f32; 9],
5634}
5635impl ATTITUDE_QUATERNION_COV_DATA {
5636 pub const ENCODED_LEN: usize = 72usize;
5637 pub const DEFAULT: Self = Self {
5638 time_usec: 0_u64,
5639 q: [0.0_f32; 4usize],
5640 rollspeed: 0.0_f32,
5641 pitchspeed: 0.0_f32,
5642 yawspeed: 0.0_f32,
5643 covariance: [0.0_f32; 9usize],
5644 };
5645 #[cfg(feature = "arbitrary")]
5646 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5647 use arbitrary::{Arbitrary, Unstructured};
5648 let mut buf = [0u8; 1024];
5649 rng.fill_bytes(&mut buf);
5650 let mut unstructured = Unstructured::new(&buf);
5651 Self::arbitrary(&mut unstructured).unwrap_or_default()
5652 }
5653}
5654impl Default for ATTITUDE_QUATERNION_COV_DATA {
5655 fn default() -> Self {
5656 Self::DEFAULT.clone()
5657 }
5658}
5659impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5660 type Message = MavMessage;
5661 const ID: u32 = 61u32;
5662 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5663 const EXTRA_CRC: u8 = 167u8;
5664 const ENCODED_LEN: usize = 72usize;
5665 fn deser(
5666 _version: MavlinkVersion,
5667 __input: &[u8],
5668 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5669 let avail_len = __input.len();
5670 let mut payload_buf = [0; Self::ENCODED_LEN];
5671 let mut buf = if avail_len < Self::ENCODED_LEN {
5672 payload_buf[0..avail_len].copy_from_slice(__input);
5673 Bytes::new(&payload_buf)
5674 } else {
5675 Bytes::new(__input)
5676 };
5677 let mut __struct = Self::default();
5678 __struct.time_usec = buf.get_u64_le();
5679 for v in &mut __struct.q {
5680 let val = buf.get_f32_le();
5681 *v = val;
5682 }
5683 __struct.rollspeed = buf.get_f32_le();
5684 __struct.pitchspeed = buf.get_f32_le();
5685 __struct.yawspeed = buf.get_f32_le();
5686 for v in &mut __struct.covariance {
5687 let val = buf.get_f32_le();
5688 *v = val;
5689 }
5690 Ok(__struct)
5691 }
5692 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5693 let mut __tmp = BytesMut::new(bytes);
5694 #[allow(clippy::absurd_extreme_comparisons)]
5695 #[allow(unused_comparisons)]
5696 if __tmp.remaining() < Self::ENCODED_LEN {
5697 panic!(
5698 "buffer is too small (need {} bytes, but got {})",
5699 Self::ENCODED_LEN,
5700 __tmp.remaining(),
5701 )
5702 }
5703 __tmp.put_u64_le(self.time_usec);
5704 for val in &self.q {
5705 __tmp.put_f32_le(*val);
5706 }
5707 __tmp.put_f32_le(self.rollspeed);
5708 __tmp.put_f32_le(self.pitchspeed);
5709 __tmp.put_f32_le(self.yawspeed);
5710 for val in &self.covariance {
5711 __tmp.put_f32_le(*val);
5712 }
5713 if matches!(version, MavlinkVersion::V2) {
5714 let len = __tmp.len();
5715 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5716 } else {
5717 __tmp.len()
5718 }
5719 }
5720}
5721#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5722#[doc = ""]
5723#[doc = "ID: 83"]
5724#[derive(Debug, Clone, PartialEq)]
5725#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5726#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5727#[cfg_attr(feature = "ts", derive(TS))]
5728#[cfg_attr(feature = "ts", ts(export))]
5729pub struct ATTITUDE_TARGET_DATA {
5730 #[doc = "Timestamp (time since system boot)."]
5731 pub time_boot_ms: u32,
5732 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5733 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5734 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5735 pub q: [f32; 4],
5736 #[doc = "Body roll rate"]
5737 pub body_roll_rate: f32,
5738 #[doc = "Body pitch rate"]
5739 pub body_pitch_rate: f32,
5740 #[doc = "Body yaw rate"]
5741 pub body_yaw_rate: f32,
5742 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5743 pub thrust: f32,
5744 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5745 pub type_mask: AttitudeTargetTypemask,
5746}
5747impl ATTITUDE_TARGET_DATA {
5748 pub const ENCODED_LEN: usize = 37usize;
5749 pub const DEFAULT: Self = Self {
5750 time_boot_ms: 0_u32,
5751 q: [0.0_f32; 4usize],
5752 body_roll_rate: 0.0_f32,
5753 body_pitch_rate: 0.0_f32,
5754 body_yaw_rate: 0.0_f32,
5755 thrust: 0.0_f32,
5756 type_mask: AttitudeTargetTypemask::DEFAULT,
5757 };
5758 #[cfg(feature = "arbitrary")]
5759 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5760 use arbitrary::{Arbitrary, Unstructured};
5761 let mut buf = [0u8; 1024];
5762 rng.fill_bytes(&mut buf);
5763 let mut unstructured = Unstructured::new(&buf);
5764 Self::arbitrary(&mut unstructured).unwrap_or_default()
5765 }
5766}
5767impl Default for ATTITUDE_TARGET_DATA {
5768 fn default() -> Self {
5769 Self::DEFAULT.clone()
5770 }
5771}
5772impl MessageData for ATTITUDE_TARGET_DATA {
5773 type Message = MavMessage;
5774 const ID: u32 = 83u32;
5775 const NAME: &'static str = "ATTITUDE_TARGET";
5776 const EXTRA_CRC: u8 = 22u8;
5777 const ENCODED_LEN: usize = 37usize;
5778 fn deser(
5779 _version: MavlinkVersion,
5780 __input: &[u8],
5781 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5782 let avail_len = __input.len();
5783 let mut payload_buf = [0; Self::ENCODED_LEN];
5784 let mut buf = if avail_len < Self::ENCODED_LEN {
5785 payload_buf[0..avail_len].copy_from_slice(__input);
5786 Bytes::new(&payload_buf)
5787 } else {
5788 Bytes::new(__input)
5789 };
5790 let mut __struct = Self::default();
5791 __struct.time_boot_ms = buf.get_u32_le();
5792 for v in &mut __struct.q {
5793 let val = buf.get_f32_le();
5794 *v = val;
5795 }
5796 __struct.body_roll_rate = buf.get_f32_le();
5797 __struct.body_pitch_rate = buf.get_f32_le();
5798 __struct.body_yaw_rate = buf.get_f32_le();
5799 __struct.thrust = buf.get_f32_le();
5800 let tmp = buf.get_u8();
5801 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5802 tmp & AttitudeTargetTypemask::all().bits(),
5803 )
5804 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5805 flag_type: "AttitudeTargetTypemask",
5806 value: tmp as u32,
5807 })?;
5808 Ok(__struct)
5809 }
5810 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5811 let mut __tmp = BytesMut::new(bytes);
5812 #[allow(clippy::absurd_extreme_comparisons)]
5813 #[allow(unused_comparisons)]
5814 if __tmp.remaining() < Self::ENCODED_LEN {
5815 panic!(
5816 "buffer is too small (need {} bytes, but got {})",
5817 Self::ENCODED_LEN,
5818 __tmp.remaining(),
5819 )
5820 }
5821 __tmp.put_u32_le(self.time_boot_ms);
5822 for val in &self.q {
5823 __tmp.put_f32_le(*val);
5824 }
5825 __tmp.put_f32_le(self.body_roll_rate);
5826 __tmp.put_f32_le(self.body_pitch_rate);
5827 __tmp.put_f32_le(self.body_yaw_rate);
5828 __tmp.put_f32_le(self.thrust);
5829 __tmp.put_u8(self.type_mask.bits());
5830 if matches!(version, MavlinkVersion::V2) {
5831 let len = __tmp.len();
5832 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5833 } else {
5834 __tmp.len()
5835 }
5836 }
5837}
5838#[doc = "Motion capture attitude and position."]
5839#[doc = ""]
5840#[doc = "ID: 138"]
5841#[derive(Debug, Clone, PartialEq)]
5842#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5844#[cfg_attr(feature = "ts", derive(TS))]
5845#[cfg_attr(feature = "ts", ts(export))]
5846pub struct ATT_POS_MOCAP_DATA {
5847 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5848 pub time_usec: u64,
5849 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5850 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5851 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5852 pub q: [f32; 4],
5853 #[doc = "X position (NED)"]
5854 pub x: f32,
5855 #[doc = "Y position (NED)"]
5856 pub y: f32,
5857 #[doc = "Z position (NED)"]
5858 pub z: f32,
5859 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5860 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5861 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5862 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5863 pub covariance: [f32; 21],
5864}
5865impl ATT_POS_MOCAP_DATA {
5866 pub const ENCODED_LEN: usize = 120usize;
5867 pub const DEFAULT: Self = Self {
5868 time_usec: 0_u64,
5869 q: [0.0_f32; 4usize],
5870 x: 0.0_f32,
5871 y: 0.0_f32,
5872 z: 0.0_f32,
5873 covariance: [0.0_f32; 21usize],
5874 };
5875 #[cfg(feature = "arbitrary")]
5876 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5877 use arbitrary::{Arbitrary, Unstructured};
5878 let mut buf = [0u8; 1024];
5879 rng.fill_bytes(&mut buf);
5880 let mut unstructured = Unstructured::new(&buf);
5881 Self::arbitrary(&mut unstructured).unwrap_or_default()
5882 }
5883}
5884impl Default for ATT_POS_MOCAP_DATA {
5885 fn default() -> Self {
5886 Self::DEFAULT.clone()
5887 }
5888}
5889impl MessageData for ATT_POS_MOCAP_DATA {
5890 type Message = MavMessage;
5891 const ID: u32 = 138u32;
5892 const NAME: &'static str = "ATT_POS_MOCAP";
5893 const EXTRA_CRC: u8 = 109u8;
5894 const ENCODED_LEN: usize = 120usize;
5895 fn deser(
5896 _version: MavlinkVersion,
5897 __input: &[u8],
5898 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5899 let avail_len = __input.len();
5900 let mut payload_buf = [0; Self::ENCODED_LEN];
5901 let mut buf = if avail_len < Self::ENCODED_LEN {
5902 payload_buf[0..avail_len].copy_from_slice(__input);
5903 Bytes::new(&payload_buf)
5904 } else {
5905 Bytes::new(__input)
5906 };
5907 let mut __struct = Self::default();
5908 __struct.time_usec = buf.get_u64_le();
5909 for v in &mut __struct.q {
5910 let val = buf.get_f32_le();
5911 *v = val;
5912 }
5913 __struct.x = buf.get_f32_le();
5914 __struct.y = buf.get_f32_le();
5915 __struct.z = buf.get_f32_le();
5916 for v in &mut __struct.covariance {
5917 let val = buf.get_f32_le();
5918 *v = val;
5919 }
5920 Ok(__struct)
5921 }
5922 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5923 let mut __tmp = BytesMut::new(bytes);
5924 #[allow(clippy::absurd_extreme_comparisons)]
5925 #[allow(unused_comparisons)]
5926 if __tmp.remaining() < Self::ENCODED_LEN {
5927 panic!(
5928 "buffer is too small (need {} bytes, but got {})",
5929 Self::ENCODED_LEN,
5930 __tmp.remaining(),
5931 )
5932 }
5933 __tmp.put_u64_le(self.time_usec);
5934 for val in &self.q {
5935 __tmp.put_f32_le(*val);
5936 }
5937 __tmp.put_f32_le(self.x);
5938 __tmp.put_f32_le(self.y);
5939 __tmp.put_f32_le(self.z);
5940 if matches!(version, MavlinkVersion::V2) {
5941 for val in &self.covariance {
5942 __tmp.put_f32_le(*val);
5943 }
5944 let len = __tmp.len();
5945 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5946 } else {
5947 __tmp.len()
5948 }
5949 }
5950}
5951#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5952#[doc = ""]
5953#[doc = "ID: 7"]
5954#[derive(Debug, Clone, PartialEq)]
5955#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5957#[cfg_attr(feature = "ts", derive(TS))]
5958#[cfg_attr(feature = "ts", ts(export))]
5959pub struct AUTH_KEY_DATA {
5960 #[doc = "key"]
5961 #[cfg_attr(
5962 feature = "serde",
5963 serde(
5964 serialize_with = "crate::nulstr::serialize::<_, 32>",
5965 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
5966 )
5967 )]
5968 #[cfg_attr(feature = "ts", ts(type = "string"))]
5969 pub key: [u8; 32],
5970}
5971impl AUTH_KEY_DATA {
5972 pub const ENCODED_LEN: usize = 32usize;
5973 pub const DEFAULT: Self = Self {
5974 key: [0_u8; 32usize],
5975 };
5976 #[cfg(feature = "arbitrary")]
5977 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5978 use arbitrary::{Arbitrary, Unstructured};
5979 let mut buf = [0u8; 1024];
5980 rng.fill_bytes(&mut buf);
5981 let mut unstructured = Unstructured::new(&buf);
5982 Self::arbitrary(&mut unstructured).unwrap_or_default()
5983 }
5984}
5985impl Default for AUTH_KEY_DATA {
5986 fn default() -> Self {
5987 Self::DEFAULT.clone()
5988 }
5989}
5990impl MessageData for AUTH_KEY_DATA {
5991 type Message = MavMessage;
5992 const ID: u32 = 7u32;
5993 const NAME: &'static str = "AUTH_KEY";
5994 const EXTRA_CRC: u8 = 119u8;
5995 const ENCODED_LEN: usize = 32usize;
5996 fn deser(
5997 _version: MavlinkVersion,
5998 __input: &[u8],
5999 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6000 let avail_len = __input.len();
6001 let mut payload_buf = [0; Self::ENCODED_LEN];
6002 let mut buf = if avail_len < Self::ENCODED_LEN {
6003 payload_buf[0..avail_len].copy_from_slice(__input);
6004 Bytes::new(&payload_buf)
6005 } else {
6006 Bytes::new(__input)
6007 };
6008 let mut __struct = Self::default();
6009 for v in &mut __struct.key {
6010 let val = buf.get_u8();
6011 *v = val;
6012 }
6013 Ok(__struct)
6014 }
6015 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6016 let mut __tmp = BytesMut::new(bytes);
6017 #[allow(clippy::absurd_extreme_comparisons)]
6018 #[allow(unused_comparisons)]
6019 if __tmp.remaining() < Self::ENCODED_LEN {
6020 panic!(
6021 "buffer is too small (need {} bytes, but got {})",
6022 Self::ENCODED_LEN,
6023 __tmp.remaining(),
6024 )
6025 }
6026 for val in &self.key {
6027 __tmp.put_u8(*val);
6028 }
6029 if matches!(version, MavlinkVersion::V2) {
6030 let len = __tmp.len();
6031 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6032 } else {
6033 __tmp.len()
6034 }
6035 }
6036}
6037#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
6038#[doc = ""]
6039#[doc = "ID: 286"]
6040#[derive(Debug, Clone, PartialEq)]
6041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6043#[cfg_attr(feature = "ts", derive(TS))]
6044#[cfg_attr(feature = "ts", ts(export))]
6045pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6046 #[doc = "Timestamp (time since system boot)."]
6047 pub time_boot_us: u64,
6048 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
6049 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6050 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6051 pub q: [f32; 4],
6052 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
6053 pub q_estimated_delay_us: u32,
6054 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
6055 pub vx: f32,
6056 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
6057 pub vy: f32,
6058 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
6059 pub vz: f32,
6060 #[doc = "Estimated delay of the speed data. 0 if unknown."]
6061 pub v_estimated_delay_us: u32,
6062 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
6063 pub feed_forward_angular_velocity_z: f32,
6064 #[doc = "Bitmap indicating which estimator outputs are valid."]
6065 pub estimator_status: EstimatorStatusFlags,
6066 #[doc = "System ID"]
6067 pub target_system: u8,
6068 #[doc = "Component ID"]
6069 pub target_component: u8,
6070 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
6071 pub landed_state: MavLandedState,
6072 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6073 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6074 pub angular_velocity_z: f32,
6075}
6076impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6077 pub const ENCODED_LEN: usize = 57usize;
6078 pub const DEFAULT: Self = Self {
6079 time_boot_us: 0_u64,
6080 q: [0.0_f32; 4usize],
6081 q_estimated_delay_us: 0_u32,
6082 vx: 0.0_f32,
6083 vy: 0.0_f32,
6084 vz: 0.0_f32,
6085 v_estimated_delay_us: 0_u32,
6086 feed_forward_angular_velocity_z: 0.0_f32,
6087 estimator_status: EstimatorStatusFlags::DEFAULT,
6088 target_system: 0_u8,
6089 target_component: 0_u8,
6090 landed_state: MavLandedState::DEFAULT,
6091 angular_velocity_z: 0.0_f32,
6092 };
6093 #[cfg(feature = "arbitrary")]
6094 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6095 use arbitrary::{Arbitrary, Unstructured};
6096 let mut buf = [0u8; 1024];
6097 rng.fill_bytes(&mut buf);
6098 let mut unstructured = Unstructured::new(&buf);
6099 Self::arbitrary(&mut unstructured).unwrap_or_default()
6100 }
6101}
6102impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6103 fn default() -> Self {
6104 Self::DEFAULT.clone()
6105 }
6106}
6107impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6108 type Message = MavMessage;
6109 const ID: u32 = 286u32;
6110 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6111 const EXTRA_CRC: u8 = 210u8;
6112 const ENCODED_LEN: usize = 57usize;
6113 fn deser(
6114 _version: MavlinkVersion,
6115 __input: &[u8],
6116 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6117 let avail_len = __input.len();
6118 let mut payload_buf = [0; Self::ENCODED_LEN];
6119 let mut buf = if avail_len < Self::ENCODED_LEN {
6120 payload_buf[0..avail_len].copy_from_slice(__input);
6121 Bytes::new(&payload_buf)
6122 } else {
6123 Bytes::new(__input)
6124 };
6125 let mut __struct = Self::default();
6126 __struct.time_boot_us = buf.get_u64_le();
6127 for v in &mut __struct.q {
6128 let val = buf.get_f32_le();
6129 *v = val;
6130 }
6131 __struct.q_estimated_delay_us = buf.get_u32_le();
6132 __struct.vx = buf.get_f32_le();
6133 __struct.vy = buf.get_f32_le();
6134 __struct.vz = buf.get_f32_le();
6135 __struct.v_estimated_delay_us = buf.get_u32_le();
6136 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6137 let tmp = buf.get_u16_le();
6138 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6139 tmp & EstimatorStatusFlags::all().bits(),
6140 )
6141 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6142 flag_type: "EstimatorStatusFlags",
6143 value: tmp as u32,
6144 })?;
6145 __struct.target_system = buf.get_u8();
6146 __struct.target_component = buf.get_u8();
6147 let tmp = buf.get_u8();
6148 __struct.landed_state =
6149 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6150 enum_type: "MavLandedState",
6151 value: tmp as u32,
6152 })?;
6153 __struct.angular_velocity_z = buf.get_f32_le();
6154 Ok(__struct)
6155 }
6156 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6157 let mut __tmp = BytesMut::new(bytes);
6158 #[allow(clippy::absurd_extreme_comparisons)]
6159 #[allow(unused_comparisons)]
6160 if __tmp.remaining() < Self::ENCODED_LEN {
6161 panic!(
6162 "buffer is too small (need {} bytes, but got {})",
6163 Self::ENCODED_LEN,
6164 __tmp.remaining(),
6165 )
6166 }
6167 __tmp.put_u64_le(self.time_boot_us);
6168 for val in &self.q {
6169 __tmp.put_f32_le(*val);
6170 }
6171 __tmp.put_u32_le(self.q_estimated_delay_us);
6172 __tmp.put_f32_le(self.vx);
6173 __tmp.put_f32_le(self.vy);
6174 __tmp.put_f32_le(self.vz);
6175 __tmp.put_u32_le(self.v_estimated_delay_us);
6176 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6177 __tmp.put_u16_le(self.estimator_status.bits());
6178 __tmp.put_u8(self.target_system);
6179 __tmp.put_u8(self.target_component);
6180 __tmp.put_u8(self.landed_state as u8);
6181 if matches!(version, MavlinkVersion::V2) {
6182 __tmp.put_f32_le(self.angular_velocity_z);
6183 let len = __tmp.len();
6184 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6185 } else {
6186 __tmp.len()
6187 }
6188 }
6189}
6190#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6191#[doc = ""]
6192#[doc = "ID: 148"]
6193#[derive(Debug, Clone, PartialEq)]
6194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6196#[cfg_attr(feature = "ts", derive(TS))]
6197#[cfg_attr(feature = "ts", ts(export))]
6198pub struct AUTOPILOT_VERSION_DATA {
6199 #[doc = "Bitmap of capabilities"]
6200 pub capabilities: MavProtocolCapability,
6201 #[doc = "UID if provided by hardware (see uid2)"]
6202 pub uid: u64,
6203 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6204 pub flight_sw_version: u32,
6205 #[doc = "Middleware version number"]
6206 pub middleware_sw_version: u32,
6207 #[doc = "Operating system version number"]
6208 pub os_sw_version: u32,
6209 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6210 pub board_version: u32,
6211 #[doc = "ID of the board vendor"]
6212 pub vendor_id: u16,
6213 #[doc = "ID of the product"]
6214 pub product_id: u16,
6215 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6216 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6217 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6218 pub flight_custom_version: [u8; 8],
6219 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6220 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6221 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6222 pub middleware_custom_version: [u8; 8],
6223 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6224 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6225 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6226 pub os_custom_version: [u8; 8],
6227 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6228 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6229 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6230 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6231 pub uid2: [u8; 18],
6232}
6233impl AUTOPILOT_VERSION_DATA {
6234 pub const ENCODED_LEN: usize = 78usize;
6235 pub const DEFAULT: Self = Self {
6236 capabilities: MavProtocolCapability::DEFAULT,
6237 uid: 0_u64,
6238 flight_sw_version: 0_u32,
6239 middleware_sw_version: 0_u32,
6240 os_sw_version: 0_u32,
6241 board_version: 0_u32,
6242 vendor_id: 0_u16,
6243 product_id: 0_u16,
6244 flight_custom_version: [0_u8; 8usize],
6245 middleware_custom_version: [0_u8; 8usize],
6246 os_custom_version: [0_u8; 8usize],
6247 uid2: [0_u8; 18usize],
6248 };
6249 #[cfg(feature = "arbitrary")]
6250 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6251 use arbitrary::{Arbitrary, Unstructured};
6252 let mut buf = [0u8; 1024];
6253 rng.fill_bytes(&mut buf);
6254 let mut unstructured = Unstructured::new(&buf);
6255 Self::arbitrary(&mut unstructured).unwrap_or_default()
6256 }
6257}
6258impl Default for AUTOPILOT_VERSION_DATA {
6259 fn default() -> Self {
6260 Self::DEFAULT.clone()
6261 }
6262}
6263impl MessageData for AUTOPILOT_VERSION_DATA {
6264 type Message = MavMessage;
6265 const ID: u32 = 148u32;
6266 const NAME: &'static str = "AUTOPILOT_VERSION";
6267 const EXTRA_CRC: u8 = 178u8;
6268 const ENCODED_LEN: usize = 78usize;
6269 fn deser(
6270 _version: MavlinkVersion,
6271 __input: &[u8],
6272 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6273 let avail_len = __input.len();
6274 let mut payload_buf = [0; Self::ENCODED_LEN];
6275 let mut buf = if avail_len < Self::ENCODED_LEN {
6276 payload_buf[0..avail_len].copy_from_slice(__input);
6277 Bytes::new(&payload_buf)
6278 } else {
6279 Bytes::new(__input)
6280 };
6281 let mut __struct = Self::default();
6282 let tmp = buf.get_u64_le();
6283 __struct.capabilities = MavProtocolCapability::from_bits(
6284 tmp & MavProtocolCapability::all().bits(),
6285 )
6286 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6287 flag_type: "MavProtocolCapability",
6288 value: tmp as u32,
6289 })?;
6290 __struct.uid = buf.get_u64_le();
6291 __struct.flight_sw_version = buf.get_u32_le();
6292 __struct.middleware_sw_version = buf.get_u32_le();
6293 __struct.os_sw_version = buf.get_u32_le();
6294 __struct.board_version = buf.get_u32_le();
6295 __struct.vendor_id = buf.get_u16_le();
6296 __struct.product_id = buf.get_u16_le();
6297 for v in &mut __struct.flight_custom_version {
6298 let val = buf.get_u8();
6299 *v = val;
6300 }
6301 for v in &mut __struct.middleware_custom_version {
6302 let val = buf.get_u8();
6303 *v = val;
6304 }
6305 for v in &mut __struct.os_custom_version {
6306 let val = buf.get_u8();
6307 *v = val;
6308 }
6309 for v in &mut __struct.uid2 {
6310 let val = buf.get_u8();
6311 *v = val;
6312 }
6313 Ok(__struct)
6314 }
6315 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6316 let mut __tmp = BytesMut::new(bytes);
6317 #[allow(clippy::absurd_extreme_comparisons)]
6318 #[allow(unused_comparisons)]
6319 if __tmp.remaining() < Self::ENCODED_LEN {
6320 panic!(
6321 "buffer is too small (need {} bytes, but got {})",
6322 Self::ENCODED_LEN,
6323 __tmp.remaining(),
6324 )
6325 }
6326 __tmp.put_u64_le(self.capabilities.bits());
6327 __tmp.put_u64_le(self.uid);
6328 __tmp.put_u32_le(self.flight_sw_version);
6329 __tmp.put_u32_le(self.middleware_sw_version);
6330 __tmp.put_u32_le(self.os_sw_version);
6331 __tmp.put_u32_le(self.board_version);
6332 __tmp.put_u16_le(self.vendor_id);
6333 __tmp.put_u16_le(self.product_id);
6334 for val in &self.flight_custom_version {
6335 __tmp.put_u8(*val);
6336 }
6337 for val in &self.middleware_custom_version {
6338 __tmp.put_u8(*val);
6339 }
6340 for val in &self.os_custom_version {
6341 __tmp.put_u8(*val);
6342 }
6343 if matches!(version, MavlinkVersion::V2) {
6344 for val in &self.uid2 {
6345 __tmp.put_u8(*val);
6346 }
6347 let len = __tmp.len();
6348 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6349 } else {
6350 __tmp.len()
6351 }
6352 }
6353}
6354#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6355#[doc = ""]
6356#[doc = "ID: 435"]
6357#[derive(Debug, Clone, PartialEq)]
6358#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6360#[cfg_attr(feature = "ts", derive(TS))]
6361#[cfg_attr(feature = "ts", ts(export))]
6362pub struct AVAILABLE_MODES_DATA {
6363 #[doc = "A bitfield for use for autopilot-specific flags"]
6364 pub custom_mode: u32,
6365 #[doc = "Mode properties."]
6366 pub properties: MavModeProperty,
6367 #[doc = "The total number of available modes for the current vehicle type."]
6368 pub number_modes: u8,
6369 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6370 pub mode_index: u8,
6371 #[doc = "Standard mode."]
6372 pub standard_mode: MavStandardMode,
6373 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6374 #[cfg_attr(
6375 feature = "serde",
6376 serde(
6377 serialize_with = "crate::nulstr::serialize::<_, 35>",
6378 deserialize_with = "crate::nulstr::deserialize::<_, 35>"
6379 )
6380 )]
6381 #[cfg_attr(feature = "ts", ts(type = "string"))]
6382 pub mode_name: [u8; 35],
6383}
6384impl AVAILABLE_MODES_DATA {
6385 pub const ENCODED_LEN: usize = 46usize;
6386 pub const DEFAULT: Self = Self {
6387 custom_mode: 0_u32,
6388 properties: MavModeProperty::DEFAULT,
6389 number_modes: 0_u8,
6390 mode_index: 0_u8,
6391 standard_mode: MavStandardMode::DEFAULT,
6392 mode_name: [0_u8; 35usize],
6393 };
6394 #[cfg(feature = "arbitrary")]
6395 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6396 use arbitrary::{Arbitrary, Unstructured};
6397 let mut buf = [0u8; 1024];
6398 rng.fill_bytes(&mut buf);
6399 let mut unstructured = Unstructured::new(&buf);
6400 Self::arbitrary(&mut unstructured).unwrap_or_default()
6401 }
6402}
6403impl Default for AVAILABLE_MODES_DATA {
6404 fn default() -> Self {
6405 Self::DEFAULT.clone()
6406 }
6407}
6408impl MessageData for AVAILABLE_MODES_DATA {
6409 type Message = MavMessage;
6410 const ID: u32 = 435u32;
6411 const NAME: &'static str = "AVAILABLE_MODES";
6412 const EXTRA_CRC: u8 = 134u8;
6413 const ENCODED_LEN: usize = 46usize;
6414 fn deser(
6415 _version: MavlinkVersion,
6416 __input: &[u8],
6417 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6418 let avail_len = __input.len();
6419 let mut payload_buf = [0; Self::ENCODED_LEN];
6420 let mut buf = if avail_len < Self::ENCODED_LEN {
6421 payload_buf[0..avail_len].copy_from_slice(__input);
6422 Bytes::new(&payload_buf)
6423 } else {
6424 Bytes::new(__input)
6425 };
6426 let mut __struct = Self::default();
6427 __struct.custom_mode = buf.get_u32_le();
6428 let tmp = buf.get_u32_le();
6429 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6430 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6431 flag_type: "MavModeProperty",
6432 value: tmp as u32,
6433 })?;
6434 __struct.number_modes = buf.get_u8();
6435 __struct.mode_index = buf.get_u8();
6436 let tmp = buf.get_u8();
6437 __struct.standard_mode =
6438 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6439 enum_type: "MavStandardMode",
6440 value: tmp as u32,
6441 })?;
6442 for v in &mut __struct.mode_name {
6443 let val = buf.get_u8();
6444 *v = val;
6445 }
6446 Ok(__struct)
6447 }
6448 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6449 let mut __tmp = BytesMut::new(bytes);
6450 #[allow(clippy::absurd_extreme_comparisons)]
6451 #[allow(unused_comparisons)]
6452 if __tmp.remaining() < Self::ENCODED_LEN {
6453 panic!(
6454 "buffer is too small (need {} bytes, but got {})",
6455 Self::ENCODED_LEN,
6456 __tmp.remaining(),
6457 )
6458 }
6459 __tmp.put_u32_le(self.custom_mode);
6460 __tmp.put_u32_le(self.properties.bits());
6461 __tmp.put_u8(self.number_modes);
6462 __tmp.put_u8(self.mode_index);
6463 __tmp.put_u8(self.standard_mode as u8);
6464 for val in &self.mode_name {
6465 __tmp.put_u8(*val);
6466 }
6467 if matches!(version, MavlinkVersion::V2) {
6468 let len = __tmp.len();
6469 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6470 } else {
6471 __tmp.len()
6472 }
6473 }
6474}
6475#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6476#[doc = ""]
6477#[doc = "ID: 437"]
6478#[derive(Debug, Clone, PartialEq)]
6479#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6481#[cfg_attr(feature = "ts", derive(TS))]
6482#[cfg_attr(feature = "ts", ts(export))]
6483pub struct AVAILABLE_MODES_MONITOR_DATA {
6484 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6485 pub seq: u8,
6486}
6487impl AVAILABLE_MODES_MONITOR_DATA {
6488 pub const ENCODED_LEN: usize = 1usize;
6489 pub const DEFAULT: Self = Self { seq: 0_u8 };
6490 #[cfg(feature = "arbitrary")]
6491 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6492 use arbitrary::{Arbitrary, Unstructured};
6493 let mut buf = [0u8; 1024];
6494 rng.fill_bytes(&mut buf);
6495 let mut unstructured = Unstructured::new(&buf);
6496 Self::arbitrary(&mut unstructured).unwrap_or_default()
6497 }
6498}
6499impl Default for AVAILABLE_MODES_MONITOR_DATA {
6500 fn default() -> Self {
6501 Self::DEFAULT.clone()
6502 }
6503}
6504impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6505 type Message = MavMessage;
6506 const ID: u32 = 437u32;
6507 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6508 const EXTRA_CRC: u8 = 30u8;
6509 const ENCODED_LEN: usize = 1usize;
6510 fn deser(
6511 _version: MavlinkVersion,
6512 __input: &[u8],
6513 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6514 let avail_len = __input.len();
6515 let mut payload_buf = [0; Self::ENCODED_LEN];
6516 let mut buf = if avail_len < Self::ENCODED_LEN {
6517 payload_buf[0..avail_len].copy_from_slice(__input);
6518 Bytes::new(&payload_buf)
6519 } else {
6520 Bytes::new(__input)
6521 };
6522 let mut __struct = Self::default();
6523 __struct.seq = buf.get_u8();
6524 Ok(__struct)
6525 }
6526 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6527 let mut __tmp = BytesMut::new(bytes);
6528 #[allow(clippy::absurd_extreme_comparisons)]
6529 #[allow(unused_comparisons)]
6530 if __tmp.remaining() < Self::ENCODED_LEN {
6531 panic!(
6532 "buffer is too small (need {} bytes, but got {})",
6533 Self::ENCODED_LEN,
6534 __tmp.remaining(),
6535 )
6536 }
6537 __tmp.put_u8(self.seq);
6538 if matches!(version, MavlinkVersion::V2) {
6539 let len = __tmp.len();
6540 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6541 } else {
6542 __tmp.len()
6543 }
6544 }
6545}
6546#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6547#[doc = ""]
6548#[doc = "ID: 372"]
6549#[derive(Debug, Clone, PartialEq)]
6550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6551#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6552#[cfg_attr(feature = "ts", derive(TS))]
6553#[cfg_attr(feature = "ts", ts(export))]
6554pub struct BATTERY_INFO_DATA {
6555 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6556 pub discharge_minimum_voltage: f32,
6557 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6558 pub charging_minimum_voltage: f32,
6559 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6560 pub resting_minimum_voltage: f32,
6561 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6562 pub charging_maximum_voltage: f32,
6563 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6564 pub charging_maximum_current: f32,
6565 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6566 pub nominal_voltage: f32,
6567 #[doc = "Maximum pack discharge current. 0: field not provided."]
6568 pub discharge_maximum_current: f32,
6569 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6570 pub discharge_maximum_burst_current: f32,
6571 #[doc = "Fully charged design capacity. 0: field not provided."]
6572 pub design_capacity: f32,
6573 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6574 pub full_charge_capacity: f32,
6575 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6576 pub cycle_count: u16,
6577 #[doc = "Battery weight. 0: field not provided."]
6578 pub weight: u16,
6579 #[doc = "Battery ID"]
6580 pub id: u8,
6581 #[doc = "Function of the battery."]
6582 pub battery_function: MavBatteryFunction,
6583 #[doc = "Type (chemistry) of the battery."]
6584 pub mavtype: MavBatteryType,
6585 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6586 pub state_of_health: u8,
6587 #[doc = "Number of battery cells in series. 0: field not provided."]
6588 pub cells_in_series: u8,
6589 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6590 #[cfg_attr(
6591 feature = "serde",
6592 serde(
6593 serialize_with = "crate::nulstr::serialize::<_, 9>",
6594 deserialize_with = "crate::nulstr::deserialize::<_, 9>"
6595 )
6596 )]
6597 #[cfg_attr(feature = "ts", ts(type = "string"))]
6598 pub manufacture_date: [u8; 9],
6599 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6600 #[cfg_attr(
6601 feature = "serde",
6602 serde(
6603 serialize_with = "crate::nulstr::serialize::<_, 32>",
6604 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
6605 )
6606 )]
6607 #[cfg_attr(feature = "ts", ts(type = "string"))]
6608 pub serial_number: [u8; 32],
6609 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6610 #[cfg_attr(
6611 feature = "serde",
6612 serde(
6613 serialize_with = "crate::nulstr::serialize::<_, 50>",
6614 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
6615 )
6616 )]
6617 #[cfg_attr(feature = "ts", ts(type = "string"))]
6618 pub name: [u8; 50],
6619}
6620impl BATTERY_INFO_DATA {
6621 pub const ENCODED_LEN: usize = 140usize;
6622 pub const DEFAULT: Self = Self {
6623 discharge_minimum_voltage: 0.0_f32,
6624 charging_minimum_voltage: 0.0_f32,
6625 resting_minimum_voltage: 0.0_f32,
6626 charging_maximum_voltage: 0.0_f32,
6627 charging_maximum_current: 0.0_f32,
6628 nominal_voltage: 0.0_f32,
6629 discharge_maximum_current: 0.0_f32,
6630 discharge_maximum_burst_current: 0.0_f32,
6631 design_capacity: 0.0_f32,
6632 full_charge_capacity: 0.0_f32,
6633 cycle_count: 0_u16,
6634 weight: 0_u16,
6635 id: 0_u8,
6636 battery_function: MavBatteryFunction::DEFAULT,
6637 mavtype: MavBatteryType::DEFAULT,
6638 state_of_health: 0_u8,
6639 cells_in_series: 0_u8,
6640 manufacture_date: [0_u8; 9usize],
6641 serial_number: [0_u8; 32usize],
6642 name: [0_u8; 50usize],
6643 };
6644 #[cfg(feature = "arbitrary")]
6645 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6646 use arbitrary::{Arbitrary, Unstructured};
6647 let mut buf = [0u8; 1024];
6648 rng.fill_bytes(&mut buf);
6649 let mut unstructured = Unstructured::new(&buf);
6650 Self::arbitrary(&mut unstructured).unwrap_or_default()
6651 }
6652}
6653impl Default for BATTERY_INFO_DATA {
6654 fn default() -> Self {
6655 Self::DEFAULT.clone()
6656 }
6657}
6658impl MessageData for BATTERY_INFO_DATA {
6659 type Message = MavMessage;
6660 const ID: u32 = 372u32;
6661 const NAME: &'static str = "BATTERY_INFO";
6662 const EXTRA_CRC: u8 = 26u8;
6663 const ENCODED_LEN: usize = 140usize;
6664 fn deser(
6665 _version: MavlinkVersion,
6666 __input: &[u8],
6667 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6668 let avail_len = __input.len();
6669 let mut payload_buf = [0; Self::ENCODED_LEN];
6670 let mut buf = if avail_len < Self::ENCODED_LEN {
6671 payload_buf[0..avail_len].copy_from_slice(__input);
6672 Bytes::new(&payload_buf)
6673 } else {
6674 Bytes::new(__input)
6675 };
6676 let mut __struct = Self::default();
6677 __struct.discharge_minimum_voltage = buf.get_f32_le();
6678 __struct.charging_minimum_voltage = buf.get_f32_le();
6679 __struct.resting_minimum_voltage = buf.get_f32_le();
6680 __struct.charging_maximum_voltage = buf.get_f32_le();
6681 __struct.charging_maximum_current = buf.get_f32_le();
6682 __struct.nominal_voltage = buf.get_f32_le();
6683 __struct.discharge_maximum_current = buf.get_f32_le();
6684 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6685 __struct.design_capacity = buf.get_f32_le();
6686 __struct.full_charge_capacity = buf.get_f32_le();
6687 __struct.cycle_count = buf.get_u16_le();
6688 __struct.weight = buf.get_u16_le();
6689 __struct.id = buf.get_u8();
6690 let tmp = buf.get_u8();
6691 __struct.battery_function =
6692 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6693 enum_type: "MavBatteryFunction",
6694 value: tmp as u32,
6695 })?;
6696 let tmp = buf.get_u8();
6697 __struct.mavtype =
6698 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6699 enum_type: "MavBatteryType",
6700 value: tmp as u32,
6701 })?;
6702 __struct.state_of_health = buf.get_u8();
6703 __struct.cells_in_series = buf.get_u8();
6704 for v in &mut __struct.manufacture_date {
6705 let val = buf.get_u8();
6706 *v = val;
6707 }
6708 for v in &mut __struct.serial_number {
6709 let val = buf.get_u8();
6710 *v = val;
6711 }
6712 for v in &mut __struct.name {
6713 let val = buf.get_u8();
6714 *v = val;
6715 }
6716 Ok(__struct)
6717 }
6718 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6719 let mut __tmp = BytesMut::new(bytes);
6720 #[allow(clippy::absurd_extreme_comparisons)]
6721 #[allow(unused_comparisons)]
6722 if __tmp.remaining() < Self::ENCODED_LEN {
6723 panic!(
6724 "buffer is too small (need {} bytes, but got {})",
6725 Self::ENCODED_LEN,
6726 __tmp.remaining(),
6727 )
6728 }
6729 __tmp.put_f32_le(self.discharge_minimum_voltage);
6730 __tmp.put_f32_le(self.charging_minimum_voltage);
6731 __tmp.put_f32_le(self.resting_minimum_voltage);
6732 __tmp.put_f32_le(self.charging_maximum_voltage);
6733 __tmp.put_f32_le(self.charging_maximum_current);
6734 __tmp.put_f32_le(self.nominal_voltage);
6735 __tmp.put_f32_le(self.discharge_maximum_current);
6736 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6737 __tmp.put_f32_le(self.design_capacity);
6738 __tmp.put_f32_le(self.full_charge_capacity);
6739 __tmp.put_u16_le(self.cycle_count);
6740 __tmp.put_u16_le(self.weight);
6741 __tmp.put_u8(self.id);
6742 __tmp.put_u8(self.battery_function as u8);
6743 __tmp.put_u8(self.mavtype as u8);
6744 __tmp.put_u8(self.state_of_health);
6745 __tmp.put_u8(self.cells_in_series);
6746 for val in &self.manufacture_date {
6747 __tmp.put_u8(*val);
6748 }
6749 for val in &self.serial_number {
6750 __tmp.put_u8(*val);
6751 }
6752 for val in &self.name {
6753 __tmp.put_u8(*val);
6754 }
6755 if matches!(version, MavlinkVersion::V2) {
6756 let len = __tmp.len();
6757 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6758 } else {
6759 __tmp.len()
6760 }
6761 }
6762}
6763#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6764#[doc = ""]
6765#[doc = "ID: 147"]
6766#[derive(Debug, Clone, PartialEq)]
6767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6769#[cfg_attr(feature = "ts", derive(TS))]
6770#[cfg_attr(feature = "ts", ts(export))]
6771pub struct BATTERY_STATUS_DATA {
6772 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6773 pub current_consumed: i32,
6774 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6775 pub energy_consumed: i32,
6776 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6777 pub temperature: i16,
6778 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6779 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6780 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6781 pub voltages: [u16; 10],
6782 #[doc = "Battery current, -1: autopilot does not measure the current"]
6783 pub current_battery: i16,
6784 #[doc = "Battery ID"]
6785 pub id: u8,
6786 #[doc = "Function of the battery"]
6787 pub battery_function: MavBatteryFunction,
6788 #[doc = "Type (chemistry) of the battery"]
6789 pub mavtype: MavBatteryType,
6790 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6791 pub battery_remaining: i8,
6792 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6793 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6794 pub time_remaining: i32,
6795 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6796 #[cfg_attr(feature = "serde", serde(default))]
6797 pub charge_state: MavBatteryChargeState,
6798 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6799 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6800 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6801 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6802 pub voltages_ext: [u16; 4],
6803 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6804 #[cfg_attr(feature = "serde", serde(default))]
6805 pub mode: MavBatteryMode,
6806 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6807 #[cfg_attr(feature = "serde", serde(default))]
6808 pub fault_bitmask: MavBatteryFault,
6809}
6810impl BATTERY_STATUS_DATA {
6811 pub const ENCODED_LEN: usize = 54usize;
6812 pub const DEFAULT: Self = Self {
6813 current_consumed: 0_i32,
6814 energy_consumed: 0_i32,
6815 temperature: 0_i16,
6816 voltages: [0_u16; 10usize],
6817 current_battery: 0_i16,
6818 id: 0_u8,
6819 battery_function: MavBatteryFunction::DEFAULT,
6820 mavtype: MavBatteryType::DEFAULT,
6821 battery_remaining: 0_i8,
6822 time_remaining: 0_i32,
6823 charge_state: MavBatteryChargeState::DEFAULT,
6824 voltages_ext: [0_u16; 4usize],
6825 mode: MavBatteryMode::DEFAULT,
6826 fault_bitmask: MavBatteryFault::DEFAULT,
6827 };
6828 #[cfg(feature = "arbitrary")]
6829 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6830 use arbitrary::{Arbitrary, Unstructured};
6831 let mut buf = [0u8; 1024];
6832 rng.fill_bytes(&mut buf);
6833 let mut unstructured = Unstructured::new(&buf);
6834 Self::arbitrary(&mut unstructured).unwrap_or_default()
6835 }
6836}
6837impl Default for BATTERY_STATUS_DATA {
6838 fn default() -> Self {
6839 Self::DEFAULT.clone()
6840 }
6841}
6842impl MessageData for BATTERY_STATUS_DATA {
6843 type Message = MavMessage;
6844 const ID: u32 = 147u32;
6845 const NAME: &'static str = "BATTERY_STATUS";
6846 const EXTRA_CRC: u8 = 154u8;
6847 const ENCODED_LEN: usize = 54usize;
6848 fn deser(
6849 _version: MavlinkVersion,
6850 __input: &[u8],
6851 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6852 let avail_len = __input.len();
6853 let mut payload_buf = [0; Self::ENCODED_LEN];
6854 let mut buf = if avail_len < Self::ENCODED_LEN {
6855 payload_buf[0..avail_len].copy_from_slice(__input);
6856 Bytes::new(&payload_buf)
6857 } else {
6858 Bytes::new(__input)
6859 };
6860 let mut __struct = Self::default();
6861 __struct.current_consumed = buf.get_i32_le();
6862 __struct.energy_consumed = buf.get_i32_le();
6863 __struct.temperature = buf.get_i16_le();
6864 for v in &mut __struct.voltages {
6865 let val = buf.get_u16_le();
6866 *v = val;
6867 }
6868 __struct.current_battery = buf.get_i16_le();
6869 __struct.id = buf.get_u8();
6870 let tmp = buf.get_u8();
6871 __struct.battery_function =
6872 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6873 enum_type: "MavBatteryFunction",
6874 value: tmp as u32,
6875 })?;
6876 let tmp = buf.get_u8();
6877 __struct.mavtype =
6878 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6879 enum_type: "MavBatteryType",
6880 value: tmp as u32,
6881 })?;
6882 __struct.battery_remaining = buf.get_i8();
6883 __struct.time_remaining = buf.get_i32_le();
6884 let tmp = buf.get_u8();
6885 __struct.charge_state =
6886 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6887 enum_type: "MavBatteryChargeState",
6888 value: tmp as u32,
6889 })?;
6890 for v in &mut __struct.voltages_ext {
6891 let val = buf.get_u16_le();
6892 *v = val;
6893 }
6894 let tmp = buf.get_u8();
6895 __struct.mode =
6896 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6897 enum_type: "MavBatteryMode",
6898 value: tmp as u32,
6899 })?;
6900 let tmp = buf.get_u32_le();
6901 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6902 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6903 flag_type: "MavBatteryFault",
6904 value: tmp as u32,
6905 })?;
6906 Ok(__struct)
6907 }
6908 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6909 let mut __tmp = BytesMut::new(bytes);
6910 #[allow(clippy::absurd_extreme_comparisons)]
6911 #[allow(unused_comparisons)]
6912 if __tmp.remaining() < Self::ENCODED_LEN {
6913 panic!(
6914 "buffer is too small (need {} bytes, but got {})",
6915 Self::ENCODED_LEN,
6916 __tmp.remaining(),
6917 )
6918 }
6919 __tmp.put_i32_le(self.current_consumed);
6920 __tmp.put_i32_le(self.energy_consumed);
6921 __tmp.put_i16_le(self.temperature);
6922 for val in &self.voltages {
6923 __tmp.put_u16_le(*val);
6924 }
6925 __tmp.put_i16_le(self.current_battery);
6926 __tmp.put_u8(self.id);
6927 __tmp.put_u8(self.battery_function as u8);
6928 __tmp.put_u8(self.mavtype as u8);
6929 __tmp.put_i8(self.battery_remaining);
6930 if matches!(version, MavlinkVersion::V2) {
6931 __tmp.put_i32_le(self.time_remaining);
6932 __tmp.put_u8(self.charge_state as u8);
6933 for val in &self.voltages_ext {
6934 __tmp.put_u16_le(*val);
6935 }
6936 __tmp.put_u8(self.mode as u8);
6937 __tmp.put_u32_le(self.fault_bitmask.bits());
6938 let len = __tmp.len();
6939 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6940 } else {
6941 __tmp.len()
6942 }
6943 }
6944}
6945#[doc = "Report button state change."]
6946#[doc = ""]
6947#[doc = "ID: 257"]
6948#[derive(Debug, Clone, PartialEq)]
6949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6951#[cfg_attr(feature = "ts", derive(TS))]
6952#[cfg_attr(feature = "ts", ts(export))]
6953pub struct BUTTON_CHANGE_DATA {
6954 #[doc = "Timestamp (time since system boot)."]
6955 pub time_boot_ms: u32,
6956 #[doc = "Time of last change of button state."]
6957 pub last_change_ms: u32,
6958 #[doc = "Bitmap for state of buttons."]
6959 pub state: u8,
6960}
6961impl BUTTON_CHANGE_DATA {
6962 pub const ENCODED_LEN: usize = 9usize;
6963 pub const DEFAULT: Self = Self {
6964 time_boot_ms: 0_u32,
6965 last_change_ms: 0_u32,
6966 state: 0_u8,
6967 };
6968 #[cfg(feature = "arbitrary")]
6969 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6970 use arbitrary::{Arbitrary, Unstructured};
6971 let mut buf = [0u8; 1024];
6972 rng.fill_bytes(&mut buf);
6973 let mut unstructured = Unstructured::new(&buf);
6974 Self::arbitrary(&mut unstructured).unwrap_or_default()
6975 }
6976}
6977impl Default for BUTTON_CHANGE_DATA {
6978 fn default() -> Self {
6979 Self::DEFAULT.clone()
6980 }
6981}
6982impl MessageData for BUTTON_CHANGE_DATA {
6983 type Message = MavMessage;
6984 const ID: u32 = 257u32;
6985 const NAME: &'static str = "BUTTON_CHANGE";
6986 const EXTRA_CRC: u8 = 131u8;
6987 const ENCODED_LEN: usize = 9usize;
6988 fn deser(
6989 _version: MavlinkVersion,
6990 __input: &[u8],
6991 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6992 let avail_len = __input.len();
6993 let mut payload_buf = [0; Self::ENCODED_LEN];
6994 let mut buf = if avail_len < Self::ENCODED_LEN {
6995 payload_buf[0..avail_len].copy_from_slice(__input);
6996 Bytes::new(&payload_buf)
6997 } else {
6998 Bytes::new(__input)
6999 };
7000 let mut __struct = Self::default();
7001 __struct.time_boot_ms = buf.get_u32_le();
7002 __struct.last_change_ms = buf.get_u32_le();
7003 __struct.state = buf.get_u8();
7004 Ok(__struct)
7005 }
7006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7007 let mut __tmp = BytesMut::new(bytes);
7008 #[allow(clippy::absurd_extreme_comparisons)]
7009 #[allow(unused_comparisons)]
7010 if __tmp.remaining() < Self::ENCODED_LEN {
7011 panic!(
7012 "buffer is too small (need {} bytes, but got {})",
7013 Self::ENCODED_LEN,
7014 __tmp.remaining(),
7015 )
7016 }
7017 __tmp.put_u32_le(self.time_boot_ms);
7018 __tmp.put_u32_le(self.last_change_ms);
7019 __tmp.put_u8(self.state);
7020 if matches!(version, MavlinkVersion::V2) {
7021 let len = __tmp.len();
7022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7023 } else {
7024 __tmp.len()
7025 }
7026 }
7027}
7028#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7029#[doc = ""]
7030#[doc = "ID: 262"]
7031#[derive(Debug, Clone, PartialEq)]
7032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7034#[cfg_attr(feature = "ts", derive(TS))]
7035#[cfg_attr(feature = "ts", ts(export))]
7036pub struct CAMERA_CAPTURE_STATUS_DATA {
7037 #[doc = "Timestamp (time since system boot)."]
7038 pub time_boot_ms: u32,
7039 #[doc = "Image capture interval"]
7040 pub image_interval: f32,
7041 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7042 pub recording_time_ms: u32,
7043 #[doc = "Available storage capacity."]
7044 pub available_capacity: f32,
7045 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7046 pub image_status: u8,
7047 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7048 pub video_status: u8,
7049 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7050 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7051 pub image_count: i32,
7052 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7053 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7054 pub camera_device_id: u8,
7055}
7056impl CAMERA_CAPTURE_STATUS_DATA {
7057 pub const ENCODED_LEN: usize = 23usize;
7058 pub const DEFAULT: Self = Self {
7059 time_boot_ms: 0_u32,
7060 image_interval: 0.0_f32,
7061 recording_time_ms: 0_u32,
7062 available_capacity: 0.0_f32,
7063 image_status: 0_u8,
7064 video_status: 0_u8,
7065 image_count: 0_i32,
7066 camera_device_id: 0_u8,
7067 };
7068 #[cfg(feature = "arbitrary")]
7069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7070 use arbitrary::{Arbitrary, Unstructured};
7071 let mut buf = [0u8; 1024];
7072 rng.fill_bytes(&mut buf);
7073 let mut unstructured = Unstructured::new(&buf);
7074 Self::arbitrary(&mut unstructured).unwrap_or_default()
7075 }
7076}
7077impl Default for CAMERA_CAPTURE_STATUS_DATA {
7078 fn default() -> Self {
7079 Self::DEFAULT.clone()
7080 }
7081}
7082impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7083 type Message = MavMessage;
7084 const ID: u32 = 262u32;
7085 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7086 const EXTRA_CRC: u8 = 12u8;
7087 const ENCODED_LEN: usize = 23usize;
7088 fn deser(
7089 _version: MavlinkVersion,
7090 __input: &[u8],
7091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7092 let avail_len = __input.len();
7093 let mut payload_buf = [0; Self::ENCODED_LEN];
7094 let mut buf = if avail_len < Self::ENCODED_LEN {
7095 payload_buf[0..avail_len].copy_from_slice(__input);
7096 Bytes::new(&payload_buf)
7097 } else {
7098 Bytes::new(__input)
7099 };
7100 let mut __struct = Self::default();
7101 __struct.time_boot_ms = buf.get_u32_le();
7102 __struct.image_interval = buf.get_f32_le();
7103 __struct.recording_time_ms = buf.get_u32_le();
7104 __struct.available_capacity = buf.get_f32_le();
7105 __struct.image_status = buf.get_u8();
7106 __struct.video_status = buf.get_u8();
7107 __struct.image_count = buf.get_i32_le();
7108 __struct.camera_device_id = buf.get_u8();
7109 Ok(__struct)
7110 }
7111 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7112 let mut __tmp = BytesMut::new(bytes);
7113 #[allow(clippy::absurd_extreme_comparisons)]
7114 #[allow(unused_comparisons)]
7115 if __tmp.remaining() < Self::ENCODED_LEN {
7116 panic!(
7117 "buffer is too small (need {} bytes, but got {})",
7118 Self::ENCODED_LEN,
7119 __tmp.remaining(),
7120 )
7121 }
7122 __tmp.put_u32_le(self.time_boot_ms);
7123 __tmp.put_f32_le(self.image_interval);
7124 __tmp.put_u32_le(self.recording_time_ms);
7125 __tmp.put_f32_le(self.available_capacity);
7126 __tmp.put_u8(self.image_status);
7127 __tmp.put_u8(self.video_status);
7128 if matches!(version, MavlinkVersion::V2) {
7129 __tmp.put_i32_le(self.image_count);
7130 __tmp.put_u8(self.camera_device_id);
7131 let len = __tmp.len();
7132 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7133 } else {
7134 __tmp.len()
7135 }
7136 }
7137}
7138#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7139#[doc = ""]
7140#[doc = "ID: 271"]
7141#[derive(Debug, Clone, PartialEq)]
7142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7144#[cfg_attr(feature = "ts", derive(TS))]
7145#[cfg_attr(feature = "ts", ts(export))]
7146pub struct CAMERA_FOV_STATUS_DATA {
7147 #[doc = "Timestamp (time since system boot)."]
7148 pub time_boot_ms: u32,
7149 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7150 pub lat_camera: i32,
7151 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7152 pub lon_camera: i32,
7153 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7154 pub alt_camera: i32,
7155 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7156 pub lat_image: i32,
7157 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7158 pub lon_image: i32,
7159 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7160 pub alt_image: i32,
7161 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7162 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7163 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7164 pub q: [f32; 4],
7165 #[doc = "Horizontal field of view (NaN if unknown)."]
7166 pub hfov: f32,
7167 #[doc = "Vertical field of view (NaN if unknown)."]
7168 pub vfov: f32,
7169 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7170 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7171 pub camera_device_id: u8,
7172}
7173impl CAMERA_FOV_STATUS_DATA {
7174 pub const ENCODED_LEN: usize = 53usize;
7175 pub const DEFAULT: Self = Self {
7176 time_boot_ms: 0_u32,
7177 lat_camera: 0_i32,
7178 lon_camera: 0_i32,
7179 alt_camera: 0_i32,
7180 lat_image: 0_i32,
7181 lon_image: 0_i32,
7182 alt_image: 0_i32,
7183 q: [0.0_f32; 4usize],
7184 hfov: 0.0_f32,
7185 vfov: 0.0_f32,
7186 camera_device_id: 0_u8,
7187 };
7188 #[cfg(feature = "arbitrary")]
7189 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7190 use arbitrary::{Arbitrary, Unstructured};
7191 let mut buf = [0u8; 1024];
7192 rng.fill_bytes(&mut buf);
7193 let mut unstructured = Unstructured::new(&buf);
7194 Self::arbitrary(&mut unstructured).unwrap_or_default()
7195 }
7196}
7197impl Default for CAMERA_FOV_STATUS_DATA {
7198 fn default() -> Self {
7199 Self::DEFAULT.clone()
7200 }
7201}
7202impl MessageData for CAMERA_FOV_STATUS_DATA {
7203 type Message = MavMessage;
7204 const ID: u32 = 271u32;
7205 const NAME: &'static str = "CAMERA_FOV_STATUS";
7206 const EXTRA_CRC: u8 = 22u8;
7207 const ENCODED_LEN: usize = 53usize;
7208 fn deser(
7209 _version: MavlinkVersion,
7210 __input: &[u8],
7211 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7212 let avail_len = __input.len();
7213 let mut payload_buf = [0; Self::ENCODED_LEN];
7214 let mut buf = if avail_len < Self::ENCODED_LEN {
7215 payload_buf[0..avail_len].copy_from_slice(__input);
7216 Bytes::new(&payload_buf)
7217 } else {
7218 Bytes::new(__input)
7219 };
7220 let mut __struct = Self::default();
7221 __struct.time_boot_ms = buf.get_u32_le();
7222 __struct.lat_camera = buf.get_i32_le();
7223 __struct.lon_camera = buf.get_i32_le();
7224 __struct.alt_camera = buf.get_i32_le();
7225 __struct.lat_image = buf.get_i32_le();
7226 __struct.lon_image = buf.get_i32_le();
7227 __struct.alt_image = buf.get_i32_le();
7228 for v in &mut __struct.q {
7229 let val = buf.get_f32_le();
7230 *v = val;
7231 }
7232 __struct.hfov = buf.get_f32_le();
7233 __struct.vfov = buf.get_f32_le();
7234 __struct.camera_device_id = buf.get_u8();
7235 Ok(__struct)
7236 }
7237 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7238 let mut __tmp = BytesMut::new(bytes);
7239 #[allow(clippy::absurd_extreme_comparisons)]
7240 #[allow(unused_comparisons)]
7241 if __tmp.remaining() < Self::ENCODED_LEN {
7242 panic!(
7243 "buffer is too small (need {} bytes, but got {})",
7244 Self::ENCODED_LEN,
7245 __tmp.remaining(),
7246 )
7247 }
7248 __tmp.put_u32_le(self.time_boot_ms);
7249 __tmp.put_i32_le(self.lat_camera);
7250 __tmp.put_i32_le(self.lon_camera);
7251 __tmp.put_i32_le(self.alt_camera);
7252 __tmp.put_i32_le(self.lat_image);
7253 __tmp.put_i32_le(self.lon_image);
7254 __tmp.put_i32_le(self.alt_image);
7255 for val in &self.q {
7256 __tmp.put_f32_le(*val);
7257 }
7258 __tmp.put_f32_le(self.hfov);
7259 __tmp.put_f32_le(self.vfov);
7260 if matches!(version, MavlinkVersion::V2) {
7261 __tmp.put_u8(self.camera_device_id);
7262 let len = __tmp.len();
7263 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7264 } else {
7265 __tmp.len()
7266 }
7267 }
7268}
7269#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7270#[doc = ""]
7271#[doc = "ID: 263"]
7272#[derive(Debug, Clone, PartialEq)]
7273#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7274#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7275#[cfg_attr(feature = "ts", derive(TS))]
7276#[cfg_attr(feature = "ts", ts(export))]
7277pub struct CAMERA_IMAGE_CAPTURED_DATA {
7278 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7279 pub time_utc: u64,
7280 #[doc = "Timestamp (time since system boot)."]
7281 pub time_boot_ms: u32,
7282 #[doc = "Latitude where image was taken"]
7283 pub lat: i32,
7284 #[doc = "Longitude where capture was taken"]
7285 pub lon: i32,
7286 #[doc = "Altitude (MSL) where image was taken"]
7287 pub alt: i32,
7288 #[doc = "Altitude above ground"]
7289 pub relative_alt: i32,
7290 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7291 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7292 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7293 pub q: [f32; 4],
7294 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7295 pub image_index: i32,
7296 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7297 pub camera_id: u8,
7298 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7299 pub capture_result: i8,
7300 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7301 #[cfg_attr(
7302 feature = "serde",
7303 serde(
7304 serialize_with = "crate::nulstr::serialize::<_, 205>",
7305 deserialize_with = "crate::nulstr::deserialize::<_, 205>"
7306 )
7307 )]
7308 #[cfg_attr(feature = "ts", ts(type = "string"))]
7309 pub file_url: [u8; 205],
7310}
7311impl CAMERA_IMAGE_CAPTURED_DATA {
7312 pub const ENCODED_LEN: usize = 255usize;
7313 pub const DEFAULT: Self = Self {
7314 time_utc: 0_u64,
7315 time_boot_ms: 0_u32,
7316 lat: 0_i32,
7317 lon: 0_i32,
7318 alt: 0_i32,
7319 relative_alt: 0_i32,
7320 q: [0.0_f32; 4usize],
7321 image_index: 0_i32,
7322 camera_id: 0_u8,
7323 capture_result: 0_i8,
7324 file_url: [0_u8; 205usize],
7325 };
7326 #[cfg(feature = "arbitrary")]
7327 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7328 use arbitrary::{Arbitrary, Unstructured};
7329 let mut buf = [0u8; 1024];
7330 rng.fill_bytes(&mut buf);
7331 let mut unstructured = Unstructured::new(&buf);
7332 Self::arbitrary(&mut unstructured).unwrap_or_default()
7333 }
7334}
7335impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7336 fn default() -> Self {
7337 Self::DEFAULT.clone()
7338 }
7339}
7340impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7341 type Message = MavMessage;
7342 const ID: u32 = 263u32;
7343 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7344 const EXTRA_CRC: u8 = 133u8;
7345 const ENCODED_LEN: usize = 255usize;
7346 fn deser(
7347 _version: MavlinkVersion,
7348 __input: &[u8],
7349 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7350 let avail_len = __input.len();
7351 let mut payload_buf = [0; Self::ENCODED_LEN];
7352 let mut buf = if avail_len < Self::ENCODED_LEN {
7353 payload_buf[0..avail_len].copy_from_slice(__input);
7354 Bytes::new(&payload_buf)
7355 } else {
7356 Bytes::new(__input)
7357 };
7358 let mut __struct = Self::default();
7359 __struct.time_utc = buf.get_u64_le();
7360 __struct.time_boot_ms = buf.get_u32_le();
7361 __struct.lat = buf.get_i32_le();
7362 __struct.lon = buf.get_i32_le();
7363 __struct.alt = buf.get_i32_le();
7364 __struct.relative_alt = buf.get_i32_le();
7365 for v in &mut __struct.q {
7366 let val = buf.get_f32_le();
7367 *v = val;
7368 }
7369 __struct.image_index = buf.get_i32_le();
7370 __struct.camera_id = buf.get_u8();
7371 __struct.capture_result = buf.get_i8();
7372 for v in &mut __struct.file_url {
7373 let val = buf.get_u8();
7374 *v = val;
7375 }
7376 Ok(__struct)
7377 }
7378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7379 let mut __tmp = BytesMut::new(bytes);
7380 #[allow(clippy::absurd_extreme_comparisons)]
7381 #[allow(unused_comparisons)]
7382 if __tmp.remaining() < Self::ENCODED_LEN {
7383 panic!(
7384 "buffer is too small (need {} bytes, but got {})",
7385 Self::ENCODED_LEN,
7386 __tmp.remaining(),
7387 )
7388 }
7389 __tmp.put_u64_le(self.time_utc);
7390 __tmp.put_u32_le(self.time_boot_ms);
7391 __tmp.put_i32_le(self.lat);
7392 __tmp.put_i32_le(self.lon);
7393 __tmp.put_i32_le(self.alt);
7394 __tmp.put_i32_le(self.relative_alt);
7395 for val in &self.q {
7396 __tmp.put_f32_le(*val);
7397 }
7398 __tmp.put_i32_le(self.image_index);
7399 __tmp.put_u8(self.camera_id);
7400 __tmp.put_i8(self.capture_result);
7401 for val in &self.file_url {
7402 __tmp.put_u8(*val);
7403 }
7404 if matches!(version, MavlinkVersion::V2) {
7405 let len = __tmp.len();
7406 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7407 } else {
7408 __tmp.len()
7409 }
7410 }
7411}
7412#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7413#[doc = ""]
7414#[doc = "ID: 259"]
7415#[derive(Debug, Clone, PartialEq)]
7416#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7417#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7418#[cfg_attr(feature = "ts", derive(TS))]
7419#[cfg_attr(feature = "ts", ts(export))]
7420pub struct CAMERA_INFORMATION_DATA {
7421 #[doc = "Timestamp (time since system boot)."]
7422 pub time_boot_ms: u32,
7423 #[doc = "0xff). Use 0 if not known."]
7424 pub firmware_version: u32,
7425 #[doc = "Focal length. Use NaN if not known."]
7426 pub focal_length: f32,
7427 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7428 pub sensor_size_h: f32,
7429 #[doc = "Image sensor size vertical. Use NaN if not known."]
7430 pub sensor_size_v: f32,
7431 #[doc = "Bitmap of camera capability flags."]
7432 pub flags: CameraCapFlags,
7433 #[doc = "Horizontal image resolution. Use 0 if not known."]
7434 pub resolution_h: u16,
7435 #[doc = "Vertical image resolution. Use 0 if not known."]
7436 pub resolution_v: u16,
7437 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7438 pub cam_definition_version: u16,
7439 #[doc = "Name of the camera vendor"]
7440 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7441 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7442 pub vendor_name: [u8; 32],
7443 #[doc = "Name of the camera model"]
7444 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7445 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7446 pub model_name: [u8; 32],
7447 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7448 pub lens_id: u8,
7449 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7450 #[cfg_attr(
7451 feature = "serde",
7452 serde(
7453 serialize_with = "crate::nulstr::serialize::<_, 140>",
7454 deserialize_with = "crate::nulstr::deserialize::<_, 140>"
7455 )
7456 )]
7457 #[cfg_attr(feature = "ts", ts(type = "string"))]
7458 pub cam_definition_uri: [u8; 140],
7459 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7460 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7461 pub gimbal_device_id: u8,
7462 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7463 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7464 pub camera_device_id: u8,
7465}
7466impl CAMERA_INFORMATION_DATA {
7467 pub const ENCODED_LEN: usize = 237usize;
7468 pub const DEFAULT: Self = Self {
7469 time_boot_ms: 0_u32,
7470 firmware_version: 0_u32,
7471 focal_length: 0.0_f32,
7472 sensor_size_h: 0.0_f32,
7473 sensor_size_v: 0.0_f32,
7474 flags: CameraCapFlags::DEFAULT,
7475 resolution_h: 0_u16,
7476 resolution_v: 0_u16,
7477 cam_definition_version: 0_u16,
7478 vendor_name: [0_u8; 32usize],
7479 model_name: [0_u8; 32usize],
7480 lens_id: 0_u8,
7481 cam_definition_uri: [0_u8; 140usize],
7482 gimbal_device_id: 0_u8,
7483 camera_device_id: 0_u8,
7484 };
7485 #[cfg(feature = "arbitrary")]
7486 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7487 use arbitrary::{Arbitrary, Unstructured};
7488 let mut buf = [0u8; 1024];
7489 rng.fill_bytes(&mut buf);
7490 let mut unstructured = Unstructured::new(&buf);
7491 Self::arbitrary(&mut unstructured).unwrap_or_default()
7492 }
7493}
7494impl Default for CAMERA_INFORMATION_DATA {
7495 fn default() -> Self {
7496 Self::DEFAULT.clone()
7497 }
7498}
7499impl MessageData for CAMERA_INFORMATION_DATA {
7500 type Message = MavMessage;
7501 const ID: u32 = 259u32;
7502 const NAME: &'static str = "CAMERA_INFORMATION";
7503 const EXTRA_CRC: u8 = 92u8;
7504 const ENCODED_LEN: usize = 237usize;
7505 fn deser(
7506 _version: MavlinkVersion,
7507 __input: &[u8],
7508 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7509 let avail_len = __input.len();
7510 let mut payload_buf = [0; Self::ENCODED_LEN];
7511 let mut buf = if avail_len < Self::ENCODED_LEN {
7512 payload_buf[0..avail_len].copy_from_slice(__input);
7513 Bytes::new(&payload_buf)
7514 } else {
7515 Bytes::new(__input)
7516 };
7517 let mut __struct = Self::default();
7518 __struct.time_boot_ms = buf.get_u32_le();
7519 __struct.firmware_version = buf.get_u32_le();
7520 __struct.focal_length = buf.get_f32_le();
7521 __struct.sensor_size_h = buf.get_f32_le();
7522 __struct.sensor_size_v = buf.get_f32_le();
7523 let tmp = buf.get_u32_le();
7524 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7525 ::mavlink_core::error::ParserError::InvalidFlag {
7526 flag_type: "CameraCapFlags",
7527 value: tmp as u32,
7528 },
7529 )?;
7530 __struct.resolution_h = buf.get_u16_le();
7531 __struct.resolution_v = buf.get_u16_le();
7532 __struct.cam_definition_version = buf.get_u16_le();
7533 for v in &mut __struct.vendor_name {
7534 let val = buf.get_u8();
7535 *v = val;
7536 }
7537 for v in &mut __struct.model_name {
7538 let val = buf.get_u8();
7539 *v = val;
7540 }
7541 __struct.lens_id = buf.get_u8();
7542 for v in &mut __struct.cam_definition_uri {
7543 let val = buf.get_u8();
7544 *v = val;
7545 }
7546 __struct.gimbal_device_id = buf.get_u8();
7547 __struct.camera_device_id = buf.get_u8();
7548 Ok(__struct)
7549 }
7550 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7551 let mut __tmp = BytesMut::new(bytes);
7552 #[allow(clippy::absurd_extreme_comparisons)]
7553 #[allow(unused_comparisons)]
7554 if __tmp.remaining() < Self::ENCODED_LEN {
7555 panic!(
7556 "buffer is too small (need {} bytes, but got {})",
7557 Self::ENCODED_LEN,
7558 __tmp.remaining(),
7559 )
7560 }
7561 __tmp.put_u32_le(self.time_boot_ms);
7562 __tmp.put_u32_le(self.firmware_version);
7563 __tmp.put_f32_le(self.focal_length);
7564 __tmp.put_f32_le(self.sensor_size_h);
7565 __tmp.put_f32_le(self.sensor_size_v);
7566 __tmp.put_u32_le(self.flags.bits());
7567 __tmp.put_u16_le(self.resolution_h);
7568 __tmp.put_u16_le(self.resolution_v);
7569 __tmp.put_u16_le(self.cam_definition_version);
7570 for val in &self.vendor_name {
7571 __tmp.put_u8(*val);
7572 }
7573 for val in &self.model_name {
7574 __tmp.put_u8(*val);
7575 }
7576 __tmp.put_u8(self.lens_id);
7577 for val in &self.cam_definition_uri {
7578 __tmp.put_u8(*val);
7579 }
7580 if matches!(version, MavlinkVersion::V2) {
7581 __tmp.put_u8(self.gimbal_device_id);
7582 __tmp.put_u8(self.camera_device_id);
7583 let len = __tmp.len();
7584 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7585 } else {
7586 __tmp.len()
7587 }
7588 }
7589}
7590#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7591#[doc = ""]
7592#[doc = "ID: 260"]
7593#[derive(Debug, Clone, PartialEq)]
7594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7595#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7596#[cfg_attr(feature = "ts", derive(TS))]
7597#[cfg_attr(feature = "ts", ts(export))]
7598pub struct CAMERA_SETTINGS_DATA {
7599 #[doc = "Timestamp (time since system boot)."]
7600 pub time_boot_ms: u32,
7601 #[doc = "Camera mode"]
7602 pub mode_id: CameraMode,
7603 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7604 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7605 pub zoomLevel: f32,
7606 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7607 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7608 pub focusLevel: f32,
7609 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7610 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7611 pub camera_device_id: u8,
7612}
7613impl CAMERA_SETTINGS_DATA {
7614 pub const ENCODED_LEN: usize = 14usize;
7615 pub const DEFAULT: Self = Self {
7616 time_boot_ms: 0_u32,
7617 mode_id: CameraMode::DEFAULT,
7618 zoomLevel: 0.0_f32,
7619 focusLevel: 0.0_f32,
7620 camera_device_id: 0_u8,
7621 };
7622 #[cfg(feature = "arbitrary")]
7623 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7624 use arbitrary::{Arbitrary, Unstructured};
7625 let mut buf = [0u8; 1024];
7626 rng.fill_bytes(&mut buf);
7627 let mut unstructured = Unstructured::new(&buf);
7628 Self::arbitrary(&mut unstructured).unwrap_or_default()
7629 }
7630}
7631impl Default for CAMERA_SETTINGS_DATA {
7632 fn default() -> Self {
7633 Self::DEFAULT.clone()
7634 }
7635}
7636impl MessageData for CAMERA_SETTINGS_DATA {
7637 type Message = MavMessage;
7638 const ID: u32 = 260u32;
7639 const NAME: &'static str = "CAMERA_SETTINGS";
7640 const EXTRA_CRC: u8 = 146u8;
7641 const ENCODED_LEN: usize = 14usize;
7642 fn deser(
7643 _version: MavlinkVersion,
7644 __input: &[u8],
7645 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7646 let avail_len = __input.len();
7647 let mut payload_buf = [0; Self::ENCODED_LEN];
7648 let mut buf = if avail_len < Self::ENCODED_LEN {
7649 payload_buf[0..avail_len].copy_from_slice(__input);
7650 Bytes::new(&payload_buf)
7651 } else {
7652 Bytes::new(__input)
7653 };
7654 let mut __struct = Self::default();
7655 __struct.time_boot_ms = buf.get_u32_le();
7656 let tmp = buf.get_u8();
7657 __struct.mode_id =
7658 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7659 enum_type: "CameraMode",
7660 value: tmp as u32,
7661 })?;
7662 __struct.zoomLevel = buf.get_f32_le();
7663 __struct.focusLevel = buf.get_f32_le();
7664 __struct.camera_device_id = buf.get_u8();
7665 Ok(__struct)
7666 }
7667 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7668 let mut __tmp = BytesMut::new(bytes);
7669 #[allow(clippy::absurd_extreme_comparisons)]
7670 #[allow(unused_comparisons)]
7671 if __tmp.remaining() < Self::ENCODED_LEN {
7672 panic!(
7673 "buffer is too small (need {} bytes, but got {})",
7674 Self::ENCODED_LEN,
7675 __tmp.remaining(),
7676 )
7677 }
7678 __tmp.put_u32_le(self.time_boot_ms);
7679 __tmp.put_u8(self.mode_id as u8);
7680 if matches!(version, MavlinkVersion::V2) {
7681 __tmp.put_f32_le(self.zoomLevel);
7682 __tmp.put_f32_le(self.focusLevel);
7683 __tmp.put_u8(self.camera_device_id);
7684 let len = __tmp.len();
7685 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7686 } else {
7687 __tmp.len()
7688 }
7689 }
7690}
7691#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7692#[doc = ""]
7693#[doc = "ID: 277"]
7694#[derive(Debug, Clone, PartialEq)]
7695#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7696#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7697#[cfg_attr(feature = "ts", derive(TS))]
7698#[cfg_attr(feature = "ts", ts(export))]
7699pub struct CAMERA_THERMAL_RANGE_DATA {
7700 #[doc = "Timestamp (time since system boot)."]
7701 pub time_boot_ms: u32,
7702 #[doc = "Temperature max."]
7703 pub max: f32,
7704 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7705 pub max_point_x: f32,
7706 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7707 pub max_point_y: f32,
7708 #[doc = "Temperature min."]
7709 pub min: f32,
7710 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7711 pub min_point_x: f32,
7712 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7713 pub min_point_y: f32,
7714 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7715 pub stream_id: u8,
7716 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7717 pub camera_device_id: u8,
7718}
7719impl CAMERA_THERMAL_RANGE_DATA {
7720 pub const ENCODED_LEN: usize = 30usize;
7721 pub const DEFAULT: Self = Self {
7722 time_boot_ms: 0_u32,
7723 max: 0.0_f32,
7724 max_point_x: 0.0_f32,
7725 max_point_y: 0.0_f32,
7726 min: 0.0_f32,
7727 min_point_x: 0.0_f32,
7728 min_point_y: 0.0_f32,
7729 stream_id: 0_u8,
7730 camera_device_id: 0_u8,
7731 };
7732 #[cfg(feature = "arbitrary")]
7733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7734 use arbitrary::{Arbitrary, Unstructured};
7735 let mut buf = [0u8; 1024];
7736 rng.fill_bytes(&mut buf);
7737 let mut unstructured = Unstructured::new(&buf);
7738 Self::arbitrary(&mut unstructured).unwrap_or_default()
7739 }
7740}
7741impl Default for CAMERA_THERMAL_RANGE_DATA {
7742 fn default() -> Self {
7743 Self::DEFAULT.clone()
7744 }
7745}
7746impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7747 type Message = MavMessage;
7748 const ID: u32 = 277u32;
7749 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7750 const EXTRA_CRC: u8 = 62u8;
7751 const ENCODED_LEN: usize = 30usize;
7752 fn deser(
7753 _version: MavlinkVersion,
7754 __input: &[u8],
7755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7756 let avail_len = __input.len();
7757 let mut payload_buf = [0; Self::ENCODED_LEN];
7758 let mut buf = if avail_len < Self::ENCODED_LEN {
7759 payload_buf[0..avail_len].copy_from_slice(__input);
7760 Bytes::new(&payload_buf)
7761 } else {
7762 Bytes::new(__input)
7763 };
7764 let mut __struct = Self::default();
7765 __struct.time_boot_ms = buf.get_u32_le();
7766 __struct.max = buf.get_f32_le();
7767 __struct.max_point_x = buf.get_f32_le();
7768 __struct.max_point_y = buf.get_f32_le();
7769 __struct.min = buf.get_f32_le();
7770 __struct.min_point_x = buf.get_f32_le();
7771 __struct.min_point_y = buf.get_f32_le();
7772 __struct.stream_id = buf.get_u8();
7773 __struct.camera_device_id = buf.get_u8();
7774 Ok(__struct)
7775 }
7776 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7777 let mut __tmp = BytesMut::new(bytes);
7778 #[allow(clippy::absurd_extreme_comparisons)]
7779 #[allow(unused_comparisons)]
7780 if __tmp.remaining() < Self::ENCODED_LEN {
7781 panic!(
7782 "buffer is too small (need {} bytes, but got {})",
7783 Self::ENCODED_LEN,
7784 __tmp.remaining(),
7785 )
7786 }
7787 __tmp.put_u32_le(self.time_boot_ms);
7788 __tmp.put_f32_le(self.max);
7789 __tmp.put_f32_le(self.max_point_x);
7790 __tmp.put_f32_le(self.max_point_y);
7791 __tmp.put_f32_le(self.min);
7792 __tmp.put_f32_le(self.min_point_x);
7793 __tmp.put_f32_le(self.min_point_y);
7794 __tmp.put_u8(self.stream_id);
7795 __tmp.put_u8(self.camera_device_id);
7796 if matches!(version, MavlinkVersion::V2) {
7797 let len = __tmp.len();
7798 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7799 } else {
7800 __tmp.len()
7801 }
7802 }
7803}
7804#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7805#[doc = ""]
7806#[doc = "ID: 276"]
7807#[derive(Debug, Clone, PartialEq)]
7808#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7809#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7810#[cfg_attr(feature = "ts", derive(TS))]
7811#[cfg_attr(feature = "ts", ts(export))]
7812pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7813 #[doc = "Latitude of tracked object"]
7814 pub lat: i32,
7815 #[doc = "Longitude of tracked object"]
7816 pub lon: i32,
7817 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7818 pub alt: f32,
7819 #[doc = "Horizontal accuracy. NAN if unknown"]
7820 pub h_acc: f32,
7821 #[doc = "Vertical accuracy. NAN if unknown"]
7822 pub v_acc: f32,
7823 #[doc = "North velocity of tracked object. NAN if unknown"]
7824 pub vel_n: f32,
7825 #[doc = "East velocity of tracked object. NAN if unknown"]
7826 pub vel_e: f32,
7827 #[doc = "Down velocity of tracked object. NAN if unknown"]
7828 pub vel_d: f32,
7829 #[doc = "Velocity accuracy. NAN if unknown"]
7830 pub vel_acc: f32,
7831 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7832 pub dist: f32,
7833 #[doc = "Heading in radians, in NED. NAN if unknown"]
7834 pub hdg: f32,
7835 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7836 pub hdg_acc: f32,
7837 #[doc = "Current tracking status"]
7838 pub tracking_status: CameraTrackingStatusFlags,
7839 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7840 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7841 pub camera_device_id: u8,
7842}
7843impl CAMERA_TRACKING_GEO_STATUS_DATA {
7844 pub const ENCODED_LEN: usize = 50usize;
7845 pub const DEFAULT: Self = Self {
7846 lat: 0_i32,
7847 lon: 0_i32,
7848 alt: 0.0_f32,
7849 h_acc: 0.0_f32,
7850 v_acc: 0.0_f32,
7851 vel_n: 0.0_f32,
7852 vel_e: 0.0_f32,
7853 vel_d: 0.0_f32,
7854 vel_acc: 0.0_f32,
7855 dist: 0.0_f32,
7856 hdg: 0.0_f32,
7857 hdg_acc: 0.0_f32,
7858 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7859 camera_device_id: 0_u8,
7860 };
7861 #[cfg(feature = "arbitrary")]
7862 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7863 use arbitrary::{Arbitrary, Unstructured};
7864 let mut buf = [0u8; 1024];
7865 rng.fill_bytes(&mut buf);
7866 let mut unstructured = Unstructured::new(&buf);
7867 Self::arbitrary(&mut unstructured).unwrap_or_default()
7868 }
7869}
7870impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7871 fn default() -> Self {
7872 Self::DEFAULT.clone()
7873 }
7874}
7875impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7876 type Message = MavMessage;
7877 const ID: u32 = 276u32;
7878 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7879 const EXTRA_CRC: u8 = 18u8;
7880 const ENCODED_LEN: usize = 50usize;
7881 fn deser(
7882 _version: MavlinkVersion,
7883 __input: &[u8],
7884 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7885 let avail_len = __input.len();
7886 let mut payload_buf = [0; Self::ENCODED_LEN];
7887 let mut buf = if avail_len < Self::ENCODED_LEN {
7888 payload_buf[0..avail_len].copy_from_slice(__input);
7889 Bytes::new(&payload_buf)
7890 } else {
7891 Bytes::new(__input)
7892 };
7893 let mut __struct = Self::default();
7894 __struct.lat = buf.get_i32_le();
7895 __struct.lon = buf.get_i32_le();
7896 __struct.alt = buf.get_f32_le();
7897 __struct.h_acc = buf.get_f32_le();
7898 __struct.v_acc = buf.get_f32_le();
7899 __struct.vel_n = buf.get_f32_le();
7900 __struct.vel_e = buf.get_f32_le();
7901 __struct.vel_d = buf.get_f32_le();
7902 __struct.vel_acc = buf.get_f32_le();
7903 __struct.dist = buf.get_f32_le();
7904 __struct.hdg = buf.get_f32_le();
7905 __struct.hdg_acc = buf.get_f32_le();
7906 let tmp = buf.get_u8();
7907 __struct.tracking_status =
7908 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7909 enum_type: "CameraTrackingStatusFlags",
7910 value: tmp as u32,
7911 })?;
7912 __struct.camera_device_id = buf.get_u8();
7913 Ok(__struct)
7914 }
7915 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7916 let mut __tmp = BytesMut::new(bytes);
7917 #[allow(clippy::absurd_extreme_comparisons)]
7918 #[allow(unused_comparisons)]
7919 if __tmp.remaining() < Self::ENCODED_LEN {
7920 panic!(
7921 "buffer is too small (need {} bytes, but got {})",
7922 Self::ENCODED_LEN,
7923 __tmp.remaining(),
7924 )
7925 }
7926 __tmp.put_i32_le(self.lat);
7927 __tmp.put_i32_le(self.lon);
7928 __tmp.put_f32_le(self.alt);
7929 __tmp.put_f32_le(self.h_acc);
7930 __tmp.put_f32_le(self.v_acc);
7931 __tmp.put_f32_le(self.vel_n);
7932 __tmp.put_f32_le(self.vel_e);
7933 __tmp.put_f32_le(self.vel_d);
7934 __tmp.put_f32_le(self.vel_acc);
7935 __tmp.put_f32_le(self.dist);
7936 __tmp.put_f32_le(self.hdg);
7937 __tmp.put_f32_le(self.hdg_acc);
7938 __tmp.put_u8(self.tracking_status as u8);
7939 if matches!(version, MavlinkVersion::V2) {
7940 __tmp.put_u8(self.camera_device_id);
7941 let len = __tmp.len();
7942 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7943 } else {
7944 __tmp.len()
7945 }
7946 }
7947}
7948#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7949#[doc = ""]
7950#[doc = "ID: 275"]
7951#[derive(Debug, Clone, PartialEq)]
7952#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7954#[cfg_attr(feature = "ts", derive(TS))]
7955#[cfg_attr(feature = "ts", ts(export))]
7956pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7957 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7958 pub point_x: f32,
7959 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7960 pub point_y: f32,
7961 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7962 pub radius: f32,
7963 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7964 pub rec_top_x: f32,
7965 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7966 pub rec_top_y: f32,
7967 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7968 pub rec_bottom_x: f32,
7969 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7970 pub rec_bottom_y: f32,
7971 #[doc = "Current tracking status"]
7972 pub tracking_status: CameraTrackingStatusFlags,
7973 #[doc = "Current tracking mode"]
7974 pub tracking_mode: CameraTrackingMode,
7975 #[doc = "Defines location of target data"]
7976 pub target_data: CameraTrackingTargetData,
7977 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7978 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7979 pub camera_device_id: u8,
7980}
7981impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7982 pub const ENCODED_LEN: usize = 32usize;
7983 pub const DEFAULT: Self = Self {
7984 point_x: 0.0_f32,
7985 point_y: 0.0_f32,
7986 radius: 0.0_f32,
7987 rec_top_x: 0.0_f32,
7988 rec_top_y: 0.0_f32,
7989 rec_bottom_x: 0.0_f32,
7990 rec_bottom_y: 0.0_f32,
7991 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7992 tracking_mode: CameraTrackingMode::DEFAULT,
7993 target_data: CameraTrackingTargetData::DEFAULT,
7994 camera_device_id: 0_u8,
7995 };
7996 #[cfg(feature = "arbitrary")]
7997 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7998 use arbitrary::{Arbitrary, Unstructured};
7999 let mut buf = [0u8; 1024];
8000 rng.fill_bytes(&mut buf);
8001 let mut unstructured = Unstructured::new(&buf);
8002 Self::arbitrary(&mut unstructured).unwrap_or_default()
8003 }
8004}
8005impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8006 fn default() -> Self {
8007 Self::DEFAULT.clone()
8008 }
8009}
8010impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8011 type Message = MavMessage;
8012 const ID: u32 = 275u32;
8013 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
8014 const EXTRA_CRC: u8 = 126u8;
8015 const ENCODED_LEN: usize = 32usize;
8016 fn deser(
8017 _version: MavlinkVersion,
8018 __input: &[u8],
8019 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8020 let avail_len = __input.len();
8021 let mut payload_buf = [0; Self::ENCODED_LEN];
8022 let mut buf = if avail_len < Self::ENCODED_LEN {
8023 payload_buf[0..avail_len].copy_from_slice(__input);
8024 Bytes::new(&payload_buf)
8025 } else {
8026 Bytes::new(__input)
8027 };
8028 let mut __struct = Self::default();
8029 __struct.point_x = buf.get_f32_le();
8030 __struct.point_y = buf.get_f32_le();
8031 __struct.radius = buf.get_f32_le();
8032 __struct.rec_top_x = buf.get_f32_le();
8033 __struct.rec_top_y = buf.get_f32_le();
8034 __struct.rec_bottom_x = buf.get_f32_le();
8035 __struct.rec_bottom_y = buf.get_f32_le();
8036 let tmp = buf.get_u8();
8037 __struct.tracking_status =
8038 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8039 enum_type: "CameraTrackingStatusFlags",
8040 value: tmp as u32,
8041 })?;
8042 let tmp = buf.get_u8();
8043 __struct.tracking_mode =
8044 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8045 enum_type: "CameraTrackingMode",
8046 value: tmp as u32,
8047 })?;
8048 let tmp = buf.get_u8();
8049 __struct.target_data =
8050 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
8051 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8052 flag_type: "CameraTrackingTargetData",
8053 value: tmp as u32,
8054 })?;
8055 __struct.camera_device_id = buf.get_u8();
8056 Ok(__struct)
8057 }
8058 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8059 let mut __tmp = BytesMut::new(bytes);
8060 #[allow(clippy::absurd_extreme_comparisons)]
8061 #[allow(unused_comparisons)]
8062 if __tmp.remaining() < Self::ENCODED_LEN {
8063 panic!(
8064 "buffer is too small (need {} bytes, but got {})",
8065 Self::ENCODED_LEN,
8066 __tmp.remaining(),
8067 )
8068 }
8069 __tmp.put_f32_le(self.point_x);
8070 __tmp.put_f32_le(self.point_y);
8071 __tmp.put_f32_le(self.radius);
8072 __tmp.put_f32_le(self.rec_top_x);
8073 __tmp.put_f32_le(self.rec_top_y);
8074 __tmp.put_f32_le(self.rec_bottom_x);
8075 __tmp.put_f32_le(self.rec_bottom_y);
8076 __tmp.put_u8(self.tracking_status as u8);
8077 __tmp.put_u8(self.tracking_mode as u8);
8078 __tmp.put_u8(self.target_data.bits());
8079 if matches!(version, MavlinkVersion::V2) {
8080 __tmp.put_u8(self.camera_device_id);
8081 let len = __tmp.len();
8082 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8083 } else {
8084 __tmp.len()
8085 }
8086 }
8087}
8088#[doc = "Camera-IMU triggering and synchronisation message."]
8089#[doc = ""]
8090#[doc = "ID: 112"]
8091#[derive(Debug, Clone, PartialEq)]
8092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8094#[cfg_attr(feature = "ts", derive(TS))]
8095#[cfg_attr(feature = "ts", ts(export))]
8096pub struct CAMERA_TRIGGER_DATA {
8097 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8098 pub time_usec: u64,
8099 #[doc = "Image frame sequence"]
8100 pub seq: u32,
8101}
8102impl CAMERA_TRIGGER_DATA {
8103 pub const ENCODED_LEN: usize = 12usize;
8104 pub const DEFAULT: Self = Self {
8105 time_usec: 0_u64,
8106 seq: 0_u32,
8107 };
8108 #[cfg(feature = "arbitrary")]
8109 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8110 use arbitrary::{Arbitrary, Unstructured};
8111 let mut buf = [0u8; 1024];
8112 rng.fill_bytes(&mut buf);
8113 let mut unstructured = Unstructured::new(&buf);
8114 Self::arbitrary(&mut unstructured).unwrap_or_default()
8115 }
8116}
8117impl Default for CAMERA_TRIGGER_DATA {
8118 fn default() -> Self {
8119 Self::DEFAULT.clone()
8120 }
8121}
8122impl MessageData for CAMERA_TRIGGER_DATA {
8123 type Message = MavMessage;
8124 const ID: u32 = 112u32;
8125 const NAME: &'static str = "CAMERA_TRIGGER";
8126 const EXTRA_CRC: u8 = 174u8;
8127 const ENCODED_LEN: usize = 12usize;
8128 fn deser(
8129 _version: MavlinkVersion,
8130 __input: &[u8],
8131 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8132 let avail_len = __input.len();
8133 let mut payload_buf = [0; Self::ENCODED_LEN];
8134 let mut buf = if avail_len < Self::ENCODED_LEN {
8135 payload_buf[0..avail_len].copy_from_slice(__input);
8136 Bytes::new(&payload_buf)
8137 } else {
8138 Bytes::new(__input)
8139 };
8140 let mut __struct = Self::default();
8141 __struct.time_usec = buf.get_u64_le();
8142 __struct.seq = buf.get_u32_le();
8143 Ok(__struct)
8144 }
8145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8146 let mut __tmp = BytesMut::new(bytes);
8147 #[allow(clippy::absurd_extreme_comparisons)]
8148 #[allow(unused_comparisons)]
8149 if __tmp.remaining() < Self::ENCODED_LEN {
8150 panic!(
8151 "buffer is too small (need {} bytes, but got {})",
8152 Self::ENCODED_LEN,
8153 __tmp.remaining(),
8154 )
8155 }
8156 __tmp.put_u64_le(self.time_usec);
8157 __tmp.put_u32_le(self.seq);
8158 if matches!(version, MavlinkVersion::V2) {
8159 let len = __tmp.len();
8160 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8161 } else {
8162 __tmp.len()
8163 }
8164 }
8165}
8166#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8167#[doc = ""]
8168#[doc = "ID: 387"]
8169#[derive(Debug, Clone, PartialEq)]
8170#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8171#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8172#[cfg_attr(feature = "ts", derive(TS))]
8173#[cfg_attr(feature = "ts", ts(export))]
8174pub struct CANFD_FRAME_DATA {
8175 #[doc = "Frame ID"]
8176 pub id: u32,
8177 #[doc = "System ID."]
8178 pub target_system: u8,
8179 #[doc = "Component ID."]
8180 pub target_component: u8,
8181 #[doc = "bus number"]
8182 pub bus: u8,
8183 #[doc = "Frame length"]
8184 pub len: u8,
8185 #[doc = "Frame data"]
8186 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8187 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8188 pub data: [u8; 64],
8189}
8190impl CANFD_FRAME_DATA {
8191 pub const ENCODED_LEN: usize = 72usize;
8192 pub const DEFAULT: Self = Self {
8193 id: 0_u32,
8194 target_system: 0_u8,
8195 target_component: 0_u8,
8196 bus: 0_u8,
8197 len: 0_u8,
8198 data: [0_u8; 64usize],
8199 };
8200 #[cfg(feature = "arbitrary")]
8201 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8202 use arbitrary::{Arbitrary, Unstructured};
8203 let mut buf = [0u8; 1024];
8204 rng.fill_bytes(&mut buf);
8205 let mut unstructured = Unstructured::new(&buf);
8206 Self::arbitrary(&mut unstructured).unwrap_or_default()
8207 }
8208}
8209impl Default for CANFD_FRAME_DATA {
8210 fn default() -> Self {
8211 Self::DEFAULT.clone()
8212 }
8213}
8214impl MessageData for CANFD_FRAME_DATA {
8215 type Message = MavMessage;
8216 const ID: u32 = 387u32;
8217 const NAME: &'static str = "CANFD_FRAME";
8218 const EXTRA_CRC: u8 = 4u8;
8219 const ENCODED_LEN: usize = 72usize;
8220 fn deser(
8221 _version: MavlinkVersion,
8222 __input: &[u8],
8223 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8224 let avail_len = __input.len();
8225 let mut payload_buf = [0; Self::ENCODED_LEN];
8226 let mut buf = if avail_len < Self::ENCODED_LEN {
8227 payload_buf[0..avail_len].copy_from_slice(__input);
8228 Bytes::new(&payload_buf)
8229 } else {
8230 Bytes::new(__input)
8231 };
8232 let mut __struct = Self::default();
8233 __struct.id = buf.get_u32_le();
8234 __struct.target_system = buf.get_u8();
8235 __struct.target_component = buf.get_u8();
8236 __struct.bus = buf.get_u8();
8237 __struct.len = buf.get_u8();
8238 for v in &mut __struct.data {
8239 let val = buf.get_u8();
8240 *v = val;
8241 }
8242 Ok(__struct)
8243 }
8244 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8245 let mut __tmp = BytesMut::new(bytes);
8246 #[allow(clippy::absurd_extreme_comparisons)]
8247 #[allow(unused_comparisons)]
8248 if __tmp.remaining() < Self::ENCODED_LEN {
8249 panic!(
8250 "buffer is too small (need {} bytes, but got {})",
8251 Self::ENCODED_LEN,
8252 __tmp.remaining(),
8253 )
8254 }
8255 __tmp.put_u32_le(self.id);
8256 __tmp.put_u8(self.target_system);
8257 __tmp.put_u8(self.target_component);
8258 __tmp.put_u8(self.bus);
8259 __tmp.put_u8(self.len);
8260 for val in &self.data {
8261 __tmp.put_u8(*val);
8262 }
8263 if matches!(version, MavlinkVersion::V2) {
8264 let len = __tmp.len();
8265 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8266 } else {
8267 __tmp.len()
8268 }
8269 }
8270}
8271#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8272#[doc = ""]
8273#[doc = "ID: 388"]
8274#[derive(Debug, Clone, PartialEq)]
8275#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8276#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8277#[cfg_attr(feature = "ts", derive(TS))]
8278#[cfg_attr(feature = "ts", ts(export))]
8279pub struct CAN_FILTER_MODIFY_DATA {
8280 #[doc = "filter IDs, length num_ids"]
8281 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8282 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8283 pub ids: [u16; 16],
8284 #[doc = "System ID."]
8285 pub target_system: u8,
8286 #[doc = "Component ID."]
8287 pub target_component: u8,
8288 #[doc = "bus number"]
8289 pub bus: u8,
8290 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8291 pub operation: CanFilterOp,
8292 #[doc = "number of IDs in filter list"]
8293 pub num_ids: u8,
8294}
8295impl CAN_FILTER_MODIFY_DATA {
8296 pub const ENCODED_LEN: usize = 37usize;
8297 pub const DEFAULT: Self = Self {
8298 ids: [0_u16; 16usize],
8299 target_system: 0_u8,
8300 target_component: 0_u8,
8301 bus: 0_u8,
8302 operation: CanFilterOp::DEFAULT,
8303 num_ids: 0_u8,
8304 };
8305 #[cfg(feature = "arbitrary")]
8306 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8307 use arbitrary::{Arbitrary, Unstructured};
8308 let mut buf = [0u8; 1024];
8309 rng.fill_bytes(&mut buf);
8310 let mut unstructured = Unstructured::new(&buf);
8311 Self::arbitrary(&mut unstructured).unwrap_or_default()
8312 }
8313}
8314impl Default for CAN_FILTER_MODIFY_DATA {
8315 fn default() -> Self {
8316 Self::DEFAULT.clone()
8317 }
8318}
8319impl MessageData for CAN_FILTER_MODIFY_DATA {
8320 type Message = MavMessage;
8321 const ID: u32 = 388u32;
8322 const NAME: &'static str = "CAN_FILTER_MODIFY";
8323 const EXTRA_CRC: u8 = 8u8;
8324 const ENCODED_LEN: usize = 37usize;
8325 fn deser(
8326 _version: MavlinkVersion,
8327 __input: &[u8],
8328 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8329 let avail_len = __input.len();
8330 let mut payload_buf = [0; Self::ENCODED_LEN];
8331 let mut buf = if avail_len < Self::ENCODED_LEN {
8332 payload_buf[0..avail_len].copy_from_slice(__input);
8333 Bytes::new(&payload_buf)
8334 } else {
8335 Bytes::new(__input)
8336 };
8337 let mut __struct = Self::default();
8338 for v in &mut __struct.ids {
8339 let val = buf.get_u16_le();
8340 *v = val;
8341 }
8342 __struct.target_system = buf.get_u8();
8343 __struct.target_component = buf.get_u8();
8344 __struct.bus = buf.get_u8();
8345 let tmp = buf.get_u8();
8346 __struct.operation =
8347 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8348 enum_type: "CanFilterOp",
8349 value: tmp as u32,
8350 })?;
8351 __struct.num_ids = buf.get_u8();
8352 Ok(__struct)
8353 }
8354 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8355 let mut __tmp = BytesMut::new(bytes);
8356 #[allow(clippy::absurd_extreme_comparisons)]
8357 #[allow(unused_comparisons)]
8358 if __tmp.remaining() < Self::ENCODED_LEN {
8359 panic!(
8360 "buffer is too small (need {} bytes, but got {})",
8361 Self::ENCODED_LEN,
8362 __tmp.remaining(),
8363 )
8364 }
8365 for val in &self.ids {
8366 __tmp.put_u16_le(*val);
8367 }
8368 __tmp.put_u8(self.target_system);
8369 __tmp.put_u8(self.target_component);
8370 __tmp.put_u8(self.bus);
8371 __tmp.put_u8(self.operation as u8);
8372 __tmp.put_u8(self.num_ids);
8373 if matches!(version, MavlinkVersion::V2) {
8374 let len = __tmp.len();
8375 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8376 } else {
8377 __tmp.len()
8378 }
8379 }
8380}
8381#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8382#[doc = ""]
8383#[doc = "ID: 386"]
8384#[derive(Debug, Clone, PartialEq)]
8385#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8387#[cfg_attr(feature = "ts", derive(TS))]
8388#[cfg_attr(feature = "ts", ts(export))]
8389pub struct CAN_FRAME_DATA {
8390 #[doc = "Frame ID"]
8391 pub id: u32,
8392 #[doc = "System ID."]
8393 pub target_system: u8,
8394 #[doc = "Component ID."]
8395 pub target_component: u8,
8396 #[doc = "Bus number"]
8397 pub bus: u8,
8398 #[doc = "Frame length"]
8399 pub len: u8,
8400 #[doc = "Frame data"]
8401 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8402 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8403 pub data: [u8; 8],
8404}
8405impl CAN_FRAME_DATA {
8406 pub const ENCODED_LEN: usize = 16usize;
8407 pub const DEFAULT: Self = Self {
8408 id: 0_u32,
8409 target_system: 0_u8,
8410 target_component: 0_u8,
8411 bus: 0_u8,
8412 len: 0_u8,
8413 data: [0_u8; 8usize],
8414 };
8415 #[cfg(feature = "arbitrary")]
8416 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8417 use arbitrary::{Arbitrary, Unstructured};
8418 let mut buf = [0u8; 1024];
8419 rng.fill_bytes(&mut buf);
8420 let mut unstructured = Unstructured::new(&buf);
8421 Self::arbitrary(&mut unstructured).unwrap_or_default()
8422 }
8423}
8424impl Default for CAN_FRAME_DATA {
8425 fn default() -> Self {
8426 Self::DEFAULT.clone()
8427 }
8428}
8429impl MessageData for CAN_FRAME_DATA {
8430 type Message = MavMessage;
8431 const ID: u32 = 386u32;
8432 const NAME: &'static str = "CAN_FRAME";
8433 const EXTRA_CRC: u8 = 132u8;
8434 const ENCODED_LEN: usize = 16usize;
8435 fn deser(
8436 _version: MavlinkVersion,
8437 __input: &[u8],
8438 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8439 let avail_len = __input.len();
8440 let mut payload_buf = [0; Self::ENCODED_LEN];
8441 let mut buf = if avail_len < Self::ENCODED_LEN {
8442 payload_buf[0..avail_len].copy_from_slice(__input);
8443 Bytes::new(&payload_buf)
8444 } else {
8445 Bytes::new(__input)
8446 };
8447 let mut __struct = Self::default();
8448 __struct.id = buf.get_u32_le();
8449 __struct.target_system = buf.get_u8();
8450 __struct.target_component = buf.get_u8();
8451 __struct.bus = buf.get_u8();
8452 __struct.len = buf.get_u8();
8453 for v in &mut __struct.data {
8454 let val = buf.get_u8();
8455 *v = val;
8456 }
8457 Ok(__struct)
8458 }
8459 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8460 let mut __tmp = BytesMut::new(bytes);
8461 #[allow(clippy::absurd_extreme_comparisons)]
8462 #[allow(unused_comparisons)]
8463 if __tmp.remaining() < Self::ENCODED_LEN {
8464 panic!(
8465 "buffer is too small (need {} bytes, but got {})",
8466 Self::ENCODED_LEN,
8467 __tmp.remaining(),
8468 )
8469 }
8470 __tmp.put_u32_le(self.id);
8471 __tmp.put_u8(self.target_system);
8472 __tmp.put_u8(self.target_component);
8473 __tmp.put_u8(self.bus);
8474 __tmp.put_u8(self.len);
8475 for val in &self.data {
8476 __tmp.put_u8(*val);
8477 }
8478 if matches!(version, MavlinkVersion::V2) {
8479 let len = __tmp.len();
8480 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8481 } else {
8482 __tmp.len()
8483 }
8484 }
8485}
8486#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8487#[doc = ""]
8488#[doc = "ID: 336"]
8489#[derive(Debug, Clone, PartialEq)]
8490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8491#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8492#[cfg_attr(feature = "ts", derive(TS))]
8493#[cfg_attr(feature = "ts", ts(export))]
8494pub struct CELLULAR_CONFIG_DATA {
8495 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8496 pub enable_lte: u8,
8497 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8498 pub enable_pin: u8,
8499 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8500 #[cfg_attr(
8501 feature = "serde",
8502 serde(
8503 serialize_with = "crate::nulstr::serialize::<_, 16>",
8504 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
8505 )
8506 )]
8507 #[cfg_attr(feature = "ts", ts(type = "string"))]
8508 pub pin: [u8; 16],
8509 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8510 #[cfg_attr(
8511 feature = "serde",
8512 serde(
8513 serialize_with = "crate::nulstr::serialize::<_, 16>",
8514 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
8515 )
8516 )]
8517 #[cfg_attr(feature = "ts", ts(type = "string"))]
8518 pub new_pin: [u8; 16],
8519 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8520 #[cfg_attr(
8521 feature = "serde",
8522 serde(
8523 serialize_with = "crate::nulstr::serialize::<_, 32>",
8524 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
8525 )
8526 )]
8527 #[cfg_attr(feature = "ts", ts(type = "string"))]
8528 pub apn: [u8; 32],
8529 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8530 #[cfg_attr(
8531 feature = "serde",
8532 serde(
8533 serialize_with = "crate::nulstr::serialize::<_, 16>",
8534 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
8535 )
8536 )]
8537 #[cfg_attr(feature = "ts", ts(type = "string"))]
8538 pub puk: [u8; 16],
8539 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8540 pub roaming: u8,
8541 #[doc = "Message acceptance response (sent back to GS)."]
8542 pub response: CellularConfigResponse,
8543}
8544impl CELLULAR_CONFIG_DATA {
8545 pub const ENCODED_LEN: usize = 84usize;
8546 pub const DEFAULT: Self = Self {
8547 enable_lte: 0_u8,
8548 enable_pin: 0_u8,
8549 pin: [0_u8; 16usize],
8550 new_pin: [0_u8; 16usize],
8551 apn: [0_u8; 32usize],
8552 puk: [0_u8; 16usize],
8553 roaming: 0_u8,
8554 response: CellularConfigResponse::DEFAULT,
8555 };
8556 #[cfg(feature = "arbitrary")]
8557 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8558 use arbitrary::{Arbitrary, Unstructured};
8559 let mut buf = [0u8; 1024];
8560 rng.fill_bytes(&mut buf);
8561 let mut unstructured = Unstructured::new(&buf);
8562 Self::arbitrary(&mut unstructured).unwrap_or_default()
8563 }
8564}
8565impl Default for CELLULAR_CONFIG_DATA {
8566 fn default() -> Self {
8567 Self::DEFAULT.clone()
8568 }
8569}
8570impl MessageData for CELLULAR_CONFIG_DATA {
8571 type Message = MavMessage;
8572 const ID: u32 = 336u32;
8573 const NAME: &'static str = "CELLULAR_CONFIG";
8574 const EXTRA_CRC: u8 = 245u8;
8575 const ENCODED_LEN: usize = 84usize;
8576 fn deser(
8577 _version: MavlinkVersion,
8578 __input: &[u8],
8579 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8580 let avail_len = __input.len();
8581 let mut payload_buf = [0; Self::ENCODED_LEN];
8582 let mut buf = if avail_len < Self::ENCODED_LEN {
8583 payload_buf[0..avail_len].copy_from_slice(__input);
8584 Bytes::new(&payload_buf)
8585 } else {
8586 Bytes::new(__input)
8587 };
8588 let mut __struct = Self::default();
8589 __struct.enable_lte = buf.get_u8();
8590 __struct.enable_pin = buf.get_u8();
8591 for v in &mut __struct.pin {
8592 let val = buf.get_u8();
8593 *v = val;
8594 }
8595 for v in &mut __struct.new_pin {
8596 let val = buf.get_u8();
8597 *v = val;
8598 }
8599 for v in &mut __struct.apn {
8600 let val = buf.get_u8();
8601 *v = val;
8602 }
8603 for v in &mut __struct.puk {
8604 let val = buf.get_u8();
8605 *v = val;
8606 }
8607 __struct.roaming = buf.get_u8();
8608 let tmp = buf.get_u8();
8609 __struct.response =
8610 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8611 enum_type: "CellularConfigResponse",
8612 value: tmp as u32,
8613 })?;
8614 Ok(__struct)
8615 }
8616 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8617 let mut __tmp = BytesMut::new(bytes);
8618 #[allow(clippy::absurd_extreme_comparisons)]
8619 #[allow(unused_comparisons)]
8620 if __tmp.remaining() < Self::ENCODED_LEN {
8621 panic!(
8622 "buffer is too small (need {} bytes, but got {})",
8623 Self::ENCODED_LEN,
8624 __tmp.remaining(),
8625 )
8626 }
8627 __tmp.put_u8(self.enable_lte);
8628 __tmp.put_u8(self.enable_pin);
8629 for val in &self.pin {
8630 __tmp.put_u8(*val);
8631 }
8632 for val in &self.new_pin {
8633 __tmp.put_u8(*val);
8634 }
8635 for val in &self.apn {
8636 __tmp.put_u8(*val);
8637 }
8638 for val in &self.puk {
8639 __tmp.put_u8(*val);
8640 }
8641 __tmp.put_u8(self.roaming);
8642 __tmp.put_u8(self.response as u8);
8643 if matches!(version, MavlinkVersion::V2) {
8644 let len = __tmp.len();
8645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8646 } else {
8647 __tmp.len()
8648 }
8649 }
8650}
8651#[doc = "Report current used cellular network status."]
8652#[doc = ""]
8653#[doc = "ID: 334"]
8654#[derive(Debug, Clone, PartialEq)]
8655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8656#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8657#[cfg_attr(feature = "ts", derive(TS))]
8658#[cfg_attr(feature = "ts", ts(export))]
8659pub struct CELLULAR_STATUS_DATA {
8660 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8661 pub mcc: u16,
8662 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8663 pub mnc: u16,
8664 #[doc = "Location area code. If unknown, set to 0"]
8665 pub lac: u16,
8666 #[doc = "Cellular modem status"]
8667 pub status: CellularStatusFlag,
8668 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8669 pub failure_reason: CellularNetworkFailedReason,
8670 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8671 pub mavtype: CellularNetworkRadioType,
8672 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8673 pub quality: u8,
8674}
8675impl CELLULAR_STATUS_DATA {
8676 pub const ENCODED_LEN: usize = 10usize;
8677 pub const DEFAULT: Self = Self {
8678 mcc: 0_u16,
8679 mnc: 0_u16,
8680 lac: 0_u16,
8681 status: CellularStatusFlag::DEFAULT,
8682 failure_reason: CellularNetworkFailedReason::DEFAULT,
8683 mavtype: CellularNetworkRadioType::DEFAULT,
8684 quality: 0_u8,
8685 };
8686 #[cfg(feature = "arbitrary")]
8687 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8688 use arbitrary::{Arbitrary, Unstructured};
8689 let mut buf = [0u8; 1024];
8690 rng.fill_bytes(&mut buf);
8691 let mut unstructured = Unstructured::new(&buf);
8692 Self::arbitrary(&mut unstructured).unwrap_or_default()
8693 }
8694}
8695impl Default for CELLULAR_STATUS_DATA {
8696 fn default() -> Self {
8697 Self::DEFAULT.clone()
8698 }
8699}
8700impl MessageData for CELLULAR_STATUS_DATA {
8701 type Message = MavMessage;
8702 const ID: u32 = 334u32;
8703 const NAME: &'static str = "CELLULAR_STATUS";
8704 const EXTRA_CRC: u8 = 72u8;
8705 const ENCODED_LEN: usize = 10usize;
8706 fn deser(
8707 _version: MavlinkVersion,
8708 __input: &[u8],
8709 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8710 let avail_len = __input.len();
8711 let mut payload_buf = [0; Self::ENCODED_LEN];
8712 let mut buf = if avail_len < Self::ENCODED_LEN {
8713 payload_buf[0..avail_len].copy_from_slice(__input);
8714 Bytes::new(&payload_buf)
8715 } else {
8716 Bytes::new(__input)
8717 };
8718 let mut __struct = Self::default();
8719 __struct.mcc = buf.get_u16_le();
8720 __struct.mnc = buf.get_u16_le();
8721 __struct.lac = buf.get_u16_le();
8722 let tmp = buf.get_u8();
8723 __struct.status =
8724 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8725 enum_type: "CellularStatusFlag",
8726 value: tmp as u32,
8727 })?;
8728 let tmp = buf.get_u8();
8729 __struct.failure_reason =
8730 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8731 enum_type: "CellularNetworkFailedReason",
8732 value: tmp as u32,
8733 })?;
8734 let tmp = buf.get_u8();
8735 __struct.mavtype =
8736 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8737 enum_type: "CellularNetworkRadioType",
8738 value: tmp as u32,
8739 })?;
8740 __struct.quality = buf.get_u8();
8741 Ok(__struct)
8742 }
8743 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8744 let mut __tmp = BytesMut::new(bytes);
8745 #[allow(clippy::absurd_extreme_comparisons)]
8746 #[allow(unused_comparisons)]
8747 if __tmp.remaining() < Self::ENCODED_LEN {
8748 panic!(
8749 "buffer is too small (need {} bytes, but got {})",
8750 Self::ENCODED_LEN,
8751 __tmp.remaining(),
8752 )
8753 }
8754 __tmp.put_u16_le(self.mcc);
8755 __tmp.put_u16_le(self.mnc);
8756 __tmp.put_u16_le(self.lac);
8757 __tmp.put_u8(self.status as u8);
8758 __tmp.put_u8(self.failure_reason as u8);
8759 __tmp.put_u8(self.mavtype as u8);
8760 __tmp.put_u8(self.quality);
8761 if matches!(version, MavlinkVersion::V2) {
8762 let len = __tmp.len();
8763 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8764 } else {
8765 __tmp.len()
8766 }
8767 }
8768}
8769#[doc = "Request to control this MAV."]
8770#[doc = ""]
8771#[doc = "ID: 5"]
8772#[derive(Debug, Clone, PartialEq)]
8773#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8775#[cfg_attr(feature = "ts", derive(TS))]
8776#[cfg_attr(feature = "ts", ts(export))]
8777pub struct CHANGE_OPERATOR_CONTROL_DATA {
8778 #[doc = "System the GCS requests control for"]
8779 pub target_system: u8,
8780 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8781 pub control_request: u8,
8782 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8783 pub version: u8,
8784 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8785 #[cfg_attr(
8786 feature = "serde",
8787 serde(
8788 serialize_with = "crate::nulstr::serialize::<_, 25>",
8789 deserialize_with = "crate::nulstr::deserialize::<_, 25>"
8790 )
8791 )]
8792 #[cfg_attr(feature = "ts", ts(type = "string"))]
8793 pub passkey: [u8; 25],
8794}
8795impl CHANGE_OPERATOR_CONTROL_DATA {
8796 pub const ENCODED_LEN: usize = 28usize;
8797 pub const DEFAULT: Self = Self {
8798 target_system: 0_u8,
8799 control_request: 0_u8,
8800 version: 0_u8,
8801 passkey: [0_u8; 25usize],
8802 };
8803 #[cfg(feature = "arbitrary")]
8804 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8805 use arbitrary::{Arbitrary, Unstructured};
8806 let mut buf = [0u8; 1024];
8807 rng.fill_bytes(&mut buf);
8808 let mut unstructured = Unstructured::new(&buf);
8809 Self::arbitrary(&mut unstructured).unwrap_or_default()
8810 }
8811}
8812impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8813 fn default() -> Self {
8814 Self::DEFAULT.clone()
8815 }
8816}
8817impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8818 type Message = MavMessage;
8819 const ID: u32 = 5u32;
8820 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8821 const EXTRA_CRC: u8 = 217u8;
8822 const ENCODED_LEN: usize = 28usize;
8823 fn deser(
8824 _version: MavlinkVersion,
8825 __input: &[u8],
8826 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8827 let avail_len = __input.len();
8828 let mut payload_buf = [0; Self::ENCODED_LEN];
8829 let mut buf = if avail_len < Self::ENCODED_LEN {
8830 payload_buf[0..avail_len].copy_from_slice(__input);
8831 Bytes::new(&payload_buf)
8832 } else {
8833 Bytes::new(__input)
8834 };
8835 let mut __struct = Self::default();
8836 __struct.target_system = buf.get_u8();
8837 __struct.control_request = buf.get_u8();
8838 __struct.version = buf.get_u8();
8839 for v in &mut __struct.passkey {
8840 let val = buf.get_u8();
8841 *v = val;
8842 }
8843 Ok(__struct)
8844 }
8845 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8846 let mut __tmp = BytesMut::new(bytes);
8847 #[allow(clippy::absurd_extreme_comparisons)]
8848 #[allow(unused_comparisons)]
8849 if __tmp.remaining() < Self::ENCODED_LEN {
8850 panic!(
8851 "buffer is too small (need {} bytes, but got {})",
8852 Self::ENCODED_LEN,
8853 __tmp.remaining(),
8854 )
8855 }
8856 __tmp.put_u8(self.target_system);
8857 __tmp.put_u8(self.control_request);
8858 __tmp.put_u8(self.version);
8859 for val in &self.passkey {
8860 __tmp.put_u8(*val);
8861 }
8862 if matches!(version, MavlinkVersion::V2) {
8863 let len = __tmp.len();
8864 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8865 } else {
8866 __tmp.len()
8867 }
8868 }
8869}
8870#[doc = "Accept / deny control of this MAV."]
8871#[doc = ""]
8872#[doc = "ID: 6"]
8873#[derive(Debug, Clone, PartialEq)]
8874#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8875#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8876#[cfg_attr(feature = "ts", derive(TS))]
8877#[cfg_attr(feature = "ts", ts(export))]
8878pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8879 #[doc = "ID of the GCS this message"]
8880 pub gcs_system_id: u8,
8881 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8882 pub control_request: u8,
8883 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8884 pub ack: u8,
8885}
8886impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8887 pub const ENCODED_LEN: usize = 3usize;
8888 pub const DEFAULT: Self = Self {
8889 gcs_system_id: 0_u8,
8890 control_request: 0_u8,
8891 ack: 0_u8,
8892 };
8893 #[cfg(feature = "arbitrary")]
8894 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8895 use arbitrary::{Arbitrary, Unstructured};
8896 let mut buf = [0u8; 1024];
8897 rng.fill_bytes(&mut buf);
8898 let mut unstructured = Unstructured::new(&buf);
8899 Self::arbitrary(&mut unstructured).unwrap_or_default()
8900 }
8901}
8902impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8903 fn default() -> Self {
8904 Self::DEFAULT.clone()
8905 }
8906}
8907impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8908 type Message = MavMessage;
8909 const ID: u32 = 6u32;
8910 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8911 const EXTRA_CRC: u8 = 104u8;
8912 const ENCODED_LEN: usize = 3usize;
8913 fn deser(
8914 _version: MavlinkVersion,
8915 __input: &[u8],
8916 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8917 let avail_len = __input.len();
8918 let mut payload_buf = [0; Self::ENCODED_LEN];
8919 let mut buf = if avail_len < Self::ENCODED_LEN {
8920 payload_buf[0..avail_len].copy_from_slice(__input);
8921 Bytes::new(&payload_buf)
8922 } else {
8923 Bytes::new(__input)
8924 };
8925 let mut __struct = Self::default();
8926 __struct.gcs_system_id = buf.get_u8();
8927 __struct.control_request = buf.get_u8();
8928 __struct.ack = buf.get_u8();
8929 Ok(__struct)
8930 }
8931 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8932 let mut __tmp = BytesMut::new(bytes);
8933 #[allow(clippy::absurd_extreme_comparisons)]
8934 #[allow(unused_comparisons)]
8935 if __tmp.remaining() < Self::ENCODED_LEN {
8936 panic!(
8937 "buffer is too small (need {} bytes, but got {})",
8938 Self::ENCODED_LEN,
8939 __tmp.remaining(),
8940 )
8941 }
8942 __tmp.put_u8(self.gcs_system_id);
8943 __tmp.put_u8(self.control_request);
8944 __tmp.put_u8(self.ack);
8945 if matches!(version, MavlinkVersion::V2) {
8946 let len = __tmp.len();
8947 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8948 } else {
8949 __tmp.len()
8950 }
8951 }
8952}
8953#[doc = "Information about a potential collision."]
8954#[doc = ""]
8955#[doc = "ID: 247"]
8956#[derive(Debug, Clone, PartialEq)]
8957#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8958#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8959#[cfg_attr(feature = "ts", derive(TS))]
8960#[cfg_attr(feature = "ts", ts(export))]
8961pub struct COLLISION_DATA {
8962 #[doc = "Unique identifier, domain based on src field"]
8963 pub id: u32,
8964 #[doc = "Estimated time until collision occurs"]
8965 pub time_to_minimum_delta: f32,
8966 #[doc = "Closest vertical distance between vehicle and object"]
8967 pub altitude_minimum_delta: f32,
8968 #[doc = "Closest horizontal distance between vehicle and object"]
8969 pub horizontal_minimum_delta: f32,
8970 #[doc = "Collision data source"]
8971 pub src: MavCollisionSrc,
8972 #[doc = "Action that is being taken to avoid this collision"]
8973 pub action: MavCollisionAction,
8974 #[doc = "How concerned the aircraft is about this collision"]
8975 pub threat_level: MavCollisionThreatLevel,
8976}
8977impl COLLISION_DATA {
8978 pub const ENCODED_LEN: usize = 19usize;
8979 pub const DEFAULT: Self = Self {
8980 id: 0_u32,
8981 time_to_minimum_delta: 0.0_f32,
8982 altitude_minimum_delta: 0.0_f32,
8983 horizontal_minimum_delta: 0.0_f32,
8984 src: MavCollisionSrc::DEFAULT,
8985 action: MavCollisionAction::DEFAULT,
8986 threat_level: MavCollisionThreatLevel::DEFAULT,
8987 };
8988 #[cfg(feature = "arbitrary")]
8989 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8990 use arbitrary::{Arbitrary, Unstructured};
8991 let mut buf = [0u8; 1024];
8992 rng.fill_bytes(&mut buf);
8993 let mut unstructured = Unstructured::new(&buf);
8994 Self::arbitrary(&mut unstructured).unwrap_or_default()
8995 }
8996}
8997impl Default for COLLISION_DATA {
8998 fn default() -> Self {
8999 Self::DEFAULT.clone()
9000 }
9001}
9002impl MessageData for COLLISION_DATA {
9003 type Message = MavMessage;
9004 const ID: u32 = 247u32;
9005 const NAME: &'static str = "COLLISION";
9006 const EXTRA_CRC: u8 = 81u8;
9007 const ENCODED_LEN: usize = 19usize;
9008 fn deser(
9009 _version: MavlinkVersion,
9010 __input: &[u8],
9011 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9012 let avail_len = __input.len();
9013 let mut payload_buf = [0; Self::ENCODED_LEN];
9014 let mut buf = if avail_len < Self::ENCODED_LEN {
9015 payload_buf[0..avail_len].copy_from_slice(__input);
9016 Bytes::new(&payload_buf)
9017 } else {
9018 Bytes::new(__input)
9019 };
9020 let mut __struct = Self::default();
9021 __struct.id = buf.get_u32_le();
9022 __struct.time_to_minimum_delta = buf.get_f32_le();
9023 __struct.altitude_minimum_delta = buf.get_f32_le();
9024 __struct.horizontal_minimum_delta = buf.get_f32_le();
9025 let tmp = buf.get_u8();
9026 __struct.src =
9027 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9028 enum_type: "MavCollisionSrc",
9029 value: tmp as u32,
9030 })?;
9031 let tmp = buf.get_u8();
9032 __struct.action =
9033 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9034 enum_type: "MavCollisionAction",
9035 value: tmp as u32,
9036 })?;
9037 let tmp = buf.get_u8();
9038 __struct.threat_level =
9039 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9040 enum_type: "MavCollisionThreatLevel",
9041 value: tmp as u32,
9042 })?;
9043 Ok(__struct)
9044 }
9045 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9046 let mut __tmp = BytesMut::new(bytes);
9047 #[allow(clippy::absurd_extreme_comparisons)]
9048 #[allow(unused_comparisons)]
9049 if __tmp.remaining() < Self::ENCODED_LEN {
9050 panic!(
9051 "buffer is too small (need {} bytes, but got {})",
9052 Self::ENCODED_LEN,
9053 __tmp.remaining(),
9054 )
9055 }
9056 __tmp.put_u32_le(self.id);
9057 __tmp.put_f32_le(self.time_to_minimum_delta);
9058 __tmp.put_f32_le(self.altitude_minimum_delta);
9059 __tmp.put_f32_le(self.horizontal_minimum_delta);
9060 __tmp.put_u8(self.src as u8);
9061 __tmp.put_u8(self.action as u8);
9062 __tmp.put_u8(self.threat_level as u8);
9063 if matches!(version, MavlinkVersion::V2) {
9064 let len = __tmp.len();
9065 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9066 } else {
9067 __tmp.len()
9068 }
9069 }
9070}
9071#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9072#[doc = ""]
9073#[doc = "ID: 77"]
9074#[derive(Debug, Clone, PartialEq)]
9075#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9076#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9077#[cfg_attr(feature = "ts", derive(TS))]
9078#[cfg_attr(feature = "ts", ts(export))]
9079pub struct COMMAND_ACK_DATA {
9080 #[doc = "Command ID (of acknowledged command)."]
9081 pub command: MavCmd,
9082 #[doc = "Result of command."]
9083 pub result: MavResult,
9084 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9085 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9086 pub progress: u8,
9087 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9088 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9089 pub result_param2: i32,
9090 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9091 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9092 pub target_system: u8,
9093 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9094 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9095 pub target_component: u8,
9096}
9097impl COMMAND_ACK_DATA {
9098 pub const ENCODED_LEN: usize = 10usize;
9099 pub const DEFAULT: Self = Self {
9100 command: MavCmd::DEFAULT,
9101 result: MavResult::DEFAULT,
9102 progress: 0_u8,
9103 result_param2: 0_i32,
9104 target_system: 0_u8,
9105 target_component: 0_u8,
9106 };
9107 #[cfg(feature = "arbitrary")]
9108 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9109 use arbitrary::{Arbitrary, Unstructured};
9110 let mut buf = [0u8; 1024];
9111 rng.fill_bytes(&mut buf);
9112 let mut unstructured = Unstructured::new(&buf);
9113 Self::arbitrary(&mut unstructured).unwrap_or_default()
9114 }
9115}
9116impl Default for COMMAND_ACK_DATA {
9117 fn default() -> Self {
9118 Self::DEFAULT.clone()
9119 }
9120}
9121impl MessageData for COMMAND_ACK_DATA {
9122 type Message = MavMessage;
9123 const ID: u32 = 77u32;
9124 const NAME: &'static str = "COMMAND_ACK";
9125 const EXTRA_CRC: u8 = 143u8;
9126 const ENCODED_LEN: usize = 10usize;
9127 fn deser(
9128 _version: MavlinkVersion,
9129 __input: &[u8],
9130 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9131 let avail_len = __input.len();
9132 let mut payload_buf = [0; Self::ENCODED_LEN];
9133 let mut buf = if avail_len < Self::ENCODED_LEN {
9134 payload_buf[0..avail_len].copy_from_slice(__input);
9135 Bytes::new(&payload_buf)
9136 } else {
9137 Bytes::new(__input)
9138 };
9139 let mut __struct = Self::default();
9140 let tmp = buf.get_u16_le();
9141 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9142 ::mavlink_core::error::ParserError::InvalidEnum {
9143 enum_type: "MavCmd",
9144 value: tmp as u32,
9145 },
9146 )?;
9147 let tmp = buf.get_u8();
9148 __struct.result =
9149 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9150 enum_type: "MavResult",
9151 value: tmp as u32,
9152 })?;
9153 __struct.progress = buf.get_u8();
9154 __struct.result_param2 = buf.get_i32_le();
9155 __struct.target_system = buf.get_u8();
9156 __struct.target_component = buf.get_u8();
9157 Ok(__struct)
9158 }
9159 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9160 let mut __tmp = BytesMut::new(bytes);
9161 #[allow(clippy::absurd_extreme_comparisons)]
9162 #[allow(unused_comparisons)]
9163 if __tmp.remaining() < Self::ENCODED_LEN {
9164 panic!(
9165 "buffer is too small (need {} bytes, but got {})",
9166 Self::ENCODED_LEN,
9167 __tmp.remaining(),
9168 )
9169 }
9170 __tmp.put_u16_le(self.command as u16);
9171 __tmp.put_u8(self.result as u8);
9172 if matches!(version, MavlinkVersion::V2) {
9173 __tmp.put_u8(self.progress);
9174 __tmp.put_i32_le(self.result_param2);
9175 __tmp.put_u8(self.target_system);
9176 __tmp.put_u8(self.target_component);
9177 let len = __tmp.len();
9178 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9179 } else {
9180 __tmp.len()
9181 }
9182 }
9183}
9184#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9185#[doc = ""]
9186#[doc = "ID: 80"]
9187#[derive(Debug, Clone, PartialEq)]
9188#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9189#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9190#[cfg_attr(feature = "ts", derive(TS))]
9191#[cfg_attr(feature = "ts", ts(export))]
9192pub struct COMMAND_CANCEL_DATA {
9193 #[doc = "Command ID (of command to cancel)."]
9194 pub command: MavCmd,
9195 #[doc = "System executing long running command. Should not be broadcast (0)."]
9196 pub target_system: u8,
9197 #[doc = "Component executing long running command."]
9198 pub target_component: u8,
9199}
9200impl COMMAND_CANCEL_DATA {
9201 pub const ENCODED_LEN: usize = 4usize;
9202 pub const DEFAULT: Self = Self {
9203 command: MavCmd::DEFAULT,
9204 target_system: 0_u8,
9205 target_component: 0_u8,
9206 };
9207 #[cfg(feature = "arbitrary")]
9208 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9209 use arbitrary::{Arbitrary, Unstructured};
9210 let mut buf = [0u8; 1024];
9211 rng.fill_bytes(&mut buf);
9212 let mut unstructured = Unstructured::new(&buf);
9213 Self::arbitrary(&mut unstructured).unwrap_or_default()
9214 }
9215}
9216impl Default for COMMAND_CANCEL_DATA {
9217 fn default() -> Self {
9218 Self::DEFAULT.clone()
9219 }
9220}
9221impl MessageData for COMMAND_CANCEL_DATA {
9222 type Message = MavMessage;
9223 const ID: u32 = 80u32;
9224 const NAME: &'static str = "COMMAND_CANCEL";
9225 const EXTRA_CRC: u8 = 14u8;
9226 const ENCODED_LEN: usize = 4usize;
9227 fn deser(
9228 _version: MavlinkVersion,
9229 __input: &[u8],
9230 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9231 let avail_len = __input.len();
9232 let mut payload_buf = [0; Self::ENCODED_LEN];
9233 let mut buf = if avail_len < Self::ENCODED_LEN {
9234 payload_buf[0..avail_len].copy_from_slice(__input);
9235 Bytes::new(&payload_buf)
9236 } else {
9237 Bytes::new(__input)
9238 };
9239 let mut __struct = Self::default();
9240 let tmp = buf.get_u16_le();
9241 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9242 ::mavlink_core::error::ParserError::InvalidEnum {
9243 enum_type: "MavCmd",
9244 value: tmp as u32,
9245 },
9246 )?;
9247 __struct.target_system = buf.get_u8();
9248 __struct.target_component = buf.get_u8();
9249 Ok(__struct)
9250 }
9251 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9252 let mut __tmp = BytesMut::new(bytes);
9253 #[allow(clippy::absurd_extreme_comparisons)]
9254 #[allow(unused_comparisons)]
9255 if __tmp.remaining() < Self::ENCODED_LEN {
9256 panic!(
9257 "buffer is too small (need {} bytes, but got {})",
9258 Self::ENCODED_LEN,
9259 __tmp.remaining(),
9260 )
9261 }
9262 __tmp.put_u16_le(self.command as u16);
9263 __tmp.put_u8(self.target_system);
9264 __tmp.put_u8(self.target_component);
9265 if matches!(version, MavlinkVersion::V2) {
9266 let len = __tmp.len();
9267 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9268 } else {
9269 __tmp.len()
9270 }
9271 }
9272}
9273#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9274#[doc = ""]
9275#[doc = "ID: 75"]
9276#[derive(Debug, Clone, PartialEq)]
9277#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9278#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9279#[cfg_attr(feature = "ts", derive(TS))]
9280#[cfg_attr(feature = "ts", ts(export))]
9281pub struct COMMAND_INT_DATA {
9282 #[doc = "PARAM1, see MAV_CMD enum"]
9283 pub param1: f32,
9284 #[doc = "PARAM2, see MAV_CMD enum"]
9285 pub param2: f32,
9286 #[doc = "PARAM3, see MAV_CMD enum"]
9287 pub param3: f32,
9288 #[doc = "PARAM4, see MAV_CMD enum"]
9289 pub param4: f32,
9290 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9291 pub x: i32,
9292 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9293 pub y: i32,
9294 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9295 pub z: f32,
9296 #[doc = "The scheduled action for the mission item."]
9297 pub command: MavCmd,
9298 #[doc = "System ID"]
9299 pub target_system: u8,
9300 #[doc = "Component ID"]
9301 pub target_component: u8,
9302 #[doc = "The coordinate system of the COMMAND."]
9303 pub frame: MavFrame,
9304 #[doc = "Not used."]
9305 pub current: u8,
9306 #[doc = "Not used (set 0)."]
9307 pub autocontinue: u8,
9308}
9309impl COMMAND_INT_DATA {
9310 pub const ENCODED_LEN: usize = 35usize;
9311 pub const DEFAULT: Self = Self {
9312 param1: 0.0_f32,
9313 param2: 0.0_f32,
9314 param3: 0.0_f32,
9315 param4: 0.0_f32,
9316 x: 0_i32,
9317 y: 0_i32,
9318 z: 0.0_f32,
9319 command: MavCmd::DEFAULT,
9320 target_system: 0_u8,
9321 target_component: 0_u8,
9322 frame: MavFrame::DEFAULT,
9323 current: 0_u8,
9324 autocontinue: 0_u8,
9325 };
9326 #[cfg(feature = "arbitrary")]
9327 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9328 use arbitrary::{Arbitrary, Unstructured};
9329 let mut buf = [0u8; 1024];
9330 rng.fill_bytes(&mut buf);
9331 let mut unstructured = Unstructured::new(&buf);
9332 Self::arbitrary(&mut unstructured).unwrap_or_default()
9333 }
9334}
9335impl Default for COMMAND_INT_DATA {
9336 fn default() -> Self {
9337 Self::DEFAULT.clone()
9338 }
9339}
9340impl MessageData for COMMAND_INT_DATA {
9341 type Message = MavMessage;
9342 const ID: u32 = 75u32;
9343 const NAME: &'static str = "COMMAND_INT";
9344 const EXTRA_CRC: u8 = 158u8;
9345 const ENCODED_LEN: usize = 35usize;
9346 fn deser(
9347 _version: MavlinkVersion,
9348 __input: &[u8],
9349 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9350 let avail_len = __input.len();
9351 let mut payload_buf = [0; Self::ENCODED_LEN];
9352 let mut buf = if avail_len < Self::ENCODED_LEN {
9353 payload_buf[0..avail_len].copy_from_slice(__input);
9354 Bytes::new(&payload_buf)
9355 } else {
9356 Bytes::new(__input)
9357 };
9358 let mut __struct = Self::default();
9359 __struct.param1 = buf.get_f32_le();
9360 __struct.param2 = buf.get_f32_le();
9361 __struct.param3 = buf.get_f32_le();
9362 __struct.param4 = buf.get_f32_le();
9363 __struct.x = buf.get_i32_le();
9364 __struct.y = buf.get_i32_le();
9365 __struct.z = buf.get_f32_le();
9366 let tmp = buf.get_u16_le();
9367 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9368 ::mavlink_core::error::ParserError::InvalidEnum {
9369 enum_type: "MavCmd",
9370 value: tmp as u32,
9371 },
9372 )?;
9373 __struct.target_system = buf.get_u8();
9374 __struct.target_component = buf.get_u8();
9375 let tmp = buf.get_u8();
9376 __struct.frame =
9377 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9378 enum_type: "MavFrame",
9379 value: tmp as u32,
9380 })?;
9381 __struct.current = buf.get_u8();
9382 __struct.autocontinue = buf.get_u8();
9383 Ok(__struct)
9384 }
9385 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9386 let mut __tmp = BytesMut::new(bytes);
9387 #[allow(clippy::absurd_extreme_comparisons)]
9388 #[allow(unused_comparisons)]
9389 if __tmp.remaining() < Self::ENCODED_LEN {
9390 panic!(
9391 "buffer is too small (need {} bytes, but got {})",
9392 Self::ENCODED_LEN,
9393 __tmp.remaining(),
9394 )
9395 }
9396 __tmp.put_f32_le(self.param1);
9397 __tmp.put_f32_le(self.param2);
9398 __tmp.put_f32_le(self.param3);
9399 __tmp.put_f32_le(self.param4);
9400 __tmp.put_i32_le(self.x);
9401 __tmp.put_i32_le(self.y);
9402 __tmp.put_f32_le(self.z);
9403 __tmp.put_u16_le(self.command as u16);
9404 __tmp.put_u8(self.target_system);
9405 __tmp.put_u8(self.target_component);
9406 __tmp.put_u8(self.frame as u8);
9407 __tmp.put_u8(self.current);
9408 __tmp.put_u8(self.autocontinue);
9409 if matches!(version, MavlinkVersion::V2) {
9410 let len = __tmp.len();
9411 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9412 } else {
9413 __tmp.len()
9414 }
9415 }
9416}
9417#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9418#[doc = ""]
9419#[doc = "ID: 76"]
9420#[derive(Debug, Clone, PartialEq)]
9421#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9422#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9423#[cfg_attr(feature = "ts", derive(TS))]
9424#[cfg_attr(feature = "ts", ts(export))]
9425pub struct COMMAND_LONG_DATA {
9426 #[doc = "Parameter 1 (for the specific command)."]
9427 pub param1: f32,
9428 #[doc = "Parameter 2 (for the specific command)."]
9429 pub param2: f32,
9430 #[doc = "Parameter 3 (for the specific command)."]
9431 pub param3: f32,
9432 #[doc = "Parameter 4 (for the specific command)."]
9433 pub param4: f32,
9434 #[doc = "Parameter 5 (for the specific command)."]
9435 pub param5: f32,
9436 #[doc = "Parameter 6 (for the specific command)."]
9437 pub param6: f32,
9438 #[doc = "Parameter 7 (for the specific command)."]
9439 pub param7: f32,
9440 #[doc = "Command ID (of command to send)."]
9441 pub command: MavCmd,
9442 #[doc = "System which should execute the command"]
9443 pub target_system: u8,
9444 #[doc = "Component which should execute the command, 0 for all components"]
9445 pub target_component: u8,
9446 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9447 pub confirmation: u8,
9448}
9449impl COMMAND_LONG_DATA {
9450 pub const ENCODED_LEN: usize = 33usize;
9451 pub const DEFAULT: Self = Self {
9452 param1: 0.0_f32,
9453 param2: 0.0_f32,
9454 param3: 0.0_f32,
9455 param4: 0.0_f32,
9456 param5: 0.0_f32,
9457 param6: 0.0_f32,
9458 param7: 0.0_f32,
9459 command: MavCmd::DEFAULT,
9460 target_system: 0_u8,
9461 target_component: 0_u8,
9462 confirmation: 0_u8,
9463 };
9464 #[cfg(feature = "arbitrary")]
9465 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9466 use arbitrary::{Arbitrary, Unstructured};
9467 let mut buf = [0u8; 1024];
9468 rng.fill_bytes(&mut buf);
9469 let mut unstructured = Unstructured::new(&buf);
9470 Self::arbitrary(&mut unstructured).unwrap_or_default()
9471 }
9472}
9473impl Default for COMMAND_LONG_DATA {
9474 fn default() -> Self {
9475 Self::DEFAULT.clone()
9476 }
9477}
9478impl MessageData for COMMAND_LONG_DATA {
9479 type Message = MavMessage;
9480 const ID: u32 = 76u32;
9481 const NAME: &'static str = "COMMAND_LONG";
9482 const EXTRA_CRC: u8 = 152u8;
9483 const ENCODED_LEN: usize = 33usize;
9484 fn deser(
9485 _version: MavlinkVersion,
9486 __input: &[u8],
9487 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9488 let avail_len = __input.len();
9489 let mut payload_buf = [0; Self::ENCODED_LEN];
9490 let mut buf = if avail_len < Self::ENCODED_LEN {
9491 payload_buf[0..avail_len].copy_from_slice(__input);
9492 Bytes::new(&payload_buf)
9493 } else {
9494 Bytes::new(__input)
9495 };
9496 let mut __struct = Self::default();
9497 __struct.param1 = buf.get_f32_le();
9498 __struct.param2 = buf.get_f32_le();
9499 __struct.param3 = buf.get_f32_le();
9500 __struct.param4 = buf.get_f32_le();
9501 __struct.param5 = buf.get_f32_le();
9502 __struct.param6 = buf.get_f32_le();
9503 __struct.param7 = buf.get_f32_le();
9504 let tmp = buf.get_u16_le();
9505 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9506 ::mavlink_core::error::ParserError::InvalidEnum {
9507 enum_type: "MavCmd",
9508 value: tmp as u32,
9509 },
9510 )?;
9511 __struct.target_system = buf.get_u8();
9512 __struct.target_component = buf.get_u8();
9513 __struct.confirmation = buf.get_u8();
9514 Ok(__struct)
9515 }
9516 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9517 let mut __tmp = BytesMut::new(bytes);
9518 #[allow(clippy::absurd_extreme_comparisons)]
9519 #[allow(unused_comparisons)]
9520 if __tmp.remaining() < Self::ENCODED_LEN {
9521 panic!(
9522 "buffer is too small (need {} bytes, but got {})",
9523 Self::ENCODED_LEN,
9524 __tmp.remaining(),
9525 )
9526 }
9527 __tmp.put_f32_le(self.param1);
9528 __tmp.put_f32_le(self.param2);
9529 __tmp.put_f32_le(self.param3);
9530 __tmp.put_f32_le(self.param4);
9531 __tmp.put_f32_le(self.param5);
9532 __tmp.put_f32_le(self.param6);
9533 __tmp.put_f32_le(self.param7);
9534 __tmp.put_u16_le(self.command as u16);
9535 __tmp.put_u8(self.target_system);
9536 __tmp.put_u8(self.target_component);
9537 __tmp.put_u8(self.confirmation);
9538 if matches!(version, MavlinkVersion::V2) {
9539 let len = __tmp.len();
9540 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9541 } else {
9542 __tmp.len()
9543 }
9544 }
9545}
9546#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9547#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9548#[doc = ""]
9549#[doc = "ID: 395"]
9550#[derive(Debug, Clone, PartialEq)]
9551#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9552#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9553#[cfg_attr(feature = "ts", derive(TS))]
9554#[cfg_attr(feature = "ts", ts(export))]
9555pub struct COMPONENT_INFORMATION_DATA {
9556 #[doc = "Timestamp (time since system boot)."]
9557 pub time_boot_ms: u32,
9558 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9559 pub general_metadata_file_crc: u32,
9560 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9561 pub peripherals_metadata_file_crc: u32,
9562 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9563 #[cfg_attr(
9564 feature = "serde",
9565 serde(
9566 serialize_with = "crate::nulstr::serialize::<_, 100>",
9567 deserialize_with = "crate::nulstr::deserialize::<_, 100>"
9568 )
9569 )]
9570 #[cfg_attr(feature = "ts", ts(type = "string"))]
9571 pub general_metadata_uri: [u8; 100],
9572 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9573 #[cfg_attr(
9574 feature = "serde",
9575 serde(
9576 serialize_with = "crate::nulstr::serialize::<_, 100>",
9577 deserialize_with = "crate::nulstr::deserialize::<_, 100>"
9578 )
9579 )]
9580 #[cfg_attr(feature = "ts", ts(type = "string"))]
9581 pub peripherals_metadata_uri: [u8; 100],
9582}
9583impl COMPONENT_INFORMATION_DATA {
9584 pub const ENCODED_LEN: usize = 212usize;
9585 pub const DEFAULT: Self = Self {
9586 time_boot_ms: 0_u32,
9587 general_metadata_file_crc: 0_u32,
9588 peripherals_metadata_file_crc: 0_u32,
9589 general_metadata_uri: [0_u8; 100usize],
9590 peripherals_metadata_uri: [0_u8; 100usize],
9591 };
9592 #[cfg(feature = "arbitrary")]
9593 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9594 use arbitrary::{Arbitrary, Unstructured};
9595 let mut buf = [0u8; 1024];
9596 rng.fill_bytes(&mut buf);
9597 let mut unstructured = Unstructured::new(&buf);
9598 Self::arbitrary(&mut unstructured).unwrap_or_default()
9599 }
9600}
9601impl Default for COMPONENT_INFORMATION_DATA {
9602 fn default() -> Self {
9603 Self::DEFAULT.clone()
9604 }
9605}
9606impl MessageData for COMPONENT_INFORMATION_DATA {
9607 type Message = MavMessage;
9608 const ID: u32 = 395u32;
9609 const NAME: &'static str = "COMPONENT_INFORMATION";
9610 const EXTRA_CRC: u8 = 0u8;
9611 const ENCODED_LEN: usize = 212usize;
9612 fn deser(
9613 _version: MavlinkVersion,
9614 __input: &[u8],
9615 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9616 let avail_len = __input.len();
9617 let mut payload_buf = [0; Self::ENCODED_LEN];
9618 let mut buf = if avail_len < Self::ENCODED_LEN {
9619 payload_buf[0..avail_len].copy_from_slice(__input);
9620 Bytes::new(&payload_buf)
9621 } else {
9622 Bytes::new(__input)
9623 };
9624 let mut __struct = Self::default();
9625 __struct.time_boot_ms = buf.get_u32_le();
9626 __struct.general_metadata_file_crc = buf.get_u32_le();
9627 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9628 for v in &mut __struct.general_metadata_uri {
9629 let val = buf.get_u8();
9630 *v = val;
9631 }
9632 for v in &mut __struct.peripherals_metadata_uri {
9633 let val = buf.get_u8();
9634 *v = val;
9635 }
9636 Ok(__struct)
9637 }
9638 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9639 let mut __tmp = BytesMut::new(bytes);
9640 #[allow(clippy::absurd_extreme_comparisons)]
9641 #[allow(unused_comparisons)]
9642 if __tmp.remaining() < Self::ENCODED_LEN {
9643 panic!(
9644 "buffer is too small (need {} bytes, but got {})",
9645 Self::ENCODED_LEN,
9646 __tmp.remaining(),
9647 )
9648 }
9649 __tmp.put_u32_le(self.time_boot_ms);
9650 __tmp.put_u32_le(self.general_metadata_file_crc);
9651 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9652 for val in &self.general_metadata_uri {
9653 __tmp.put_u8(*val);
9654 }
9655 for val in &self.peripherals_metadata_uri {
9656 __tmp.put_u8(*val);
9657 }
9658 if matches!(version, MavlinkVersion::V2) {
9659 let len = __tmp.len();
9660 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9661 } else {
9662 __tmp.len()
9663 }
9664 }
9665}
9666#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9667#[doc = ""]
9668#[doc = "ID: 396"]
9669#[derive(Debug, Clone, PartialEq)]
9670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9672#[cfg_attr(feature = "ts", derive(TS))]
9673#[cfg_attr(feature = "ts", ts(export))]
9674pub struct COMPONENT_INFORMATION_BASIC_DATA {
9675 #[doc = "Component capability flags"]
9676 pub capabilities: MavProtocolCapability,
9677 #[doc = "Timestamp (time since system boot)."]
9678 pub time_boot_ms: u32,
9679 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9680 pub time_manufacture_s: u32,
9681 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9682 #[cfg_attr(
9683 feature = "serde",
9684 serde(
9685 serialize_with = "crate::nulstr::serialize::<_, 32>",
9686 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
9687 )
9688 )]
9689 #[cfg_attr(feature = "ts", ts(type = "string"))]
9690 pub vendor_name: [u8; 32],
9691 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9692 #[cfg_attr(
9693 feature = "serde",
9694 serde(
9695 serialize_with = "crate::nulstr::serialize::<_, 32>",
9696 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
9697 )
9698 )]
9699 #[cfg_attr(feature = "ts", ts(type = "string"))]
9700 pub model_name: [u8; 32],
9701 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9702 #[cfg_attr(
9703 feature = "serde",
9704 serde(
9705 serialize_with = "crate::nulstr::serialize::<_, 24>",
9706 deserialize_with = "crate::nulstr::deserialize::<_, 24>"
9707 )
9708 )]
9709 #[cfg_attr(feature = "ts", ts(type = "string"))]
9710 pub software_version: [u8; 24],
9711 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9712 #[cfg_attr(
9713 feature = "serde",
9714 serde(
9715 serialize_with = "crate::nulstr::serialize::<_, 24>",
9716 deserialize_with = "crate::nulstr::deserialize::<_, 24>"
9717 )
9718 )]
9719 #[cfg_attr(feature = "ts", ts(type = "string"))]
9720 pub hardware_version: [u8; 24],
9721 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9722 #[cfg_attr(
9723 feature = "serde",
9724 serde(
9725 serialize_with = "crate::nulstr::serialize::<_, 32>",
9726 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
9727 )
9728 )]
9729 #[cfg_attr(feature = "ts", ts(type = "string"))]
9730 pub serial_number: [u8; 32],
9731}
9732impl COMPONENT_INFORMATION_BASIC_DATA {
9733 pub const ENCODED_LEN: usize = 160usize;
9734 pub const DEFAULT: Self = Self {
9735 capabilities: MavProtocolCapability::DEFAULT,
9736 time_boot_ms: 0_u32,
9737 time_manufacture_s: 0_u32,
9738 vendor_name: [0_u8; 32usize],
9739 model_name: [0_u8; 32usize],
9740 software_version: [0_u8; 24usize],
9741 hardware_version: [0_u8; 24usize],
9742 serial_number: [0_u8; 32usize],
9743 };
9744 #[cfg(feature = "arbitrary")]
9745 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9746 use arbitrary::{Arbitrary, Unstructured};
9747 let mut buf = [0u8; 1024];
9748 rng.fill_bytes(&mut buf);
9749 let mut unstructured = Unstructured::new(&buf);
9750 Self::arbitrary(&mut unstructured).unwrap_or_default()
9751 }
9752}
9753impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9754 fn default() -> Self {
9755 Self::DEFAULT.clone()
9756 }
9757}
9758impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9759 type Message = MavMessage;
9760 const ID: u32 = 396u32;
9761 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9762 const EXTRA_CRC: u8 = 50u8;
9763 const ENCODED_LEN: usize = 160usize;
9764 fn deser(
9765 _version: MavlinkVersion,
9766 __input: &[u8],
9767 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9768 let avail_len = __input.len();
9769 let mut payload_buf = [0; Self::ENCODED_LEN];
9770 let mut buf = if avail_len < Self::ENCODED_LEN {
9771 payload_buf[0..avail_len].copy_from_slice(__input);
9772 Bytes::new(&payload_buf)
9773 } else {
9774 Bytes::new(__input)
9775 };
9776 let mut __struct = Self::default();
9777 let tmp = buf.get_u64_le();
9778 __struct.capabilities = MavProtocolCapability::from_bits(
9779 tmp & MavProtocolCapability::all().bits(),
9780 )
9781 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9782 flag_type: "MavProtocolCapability",
9783 value: tmp as u32,
9784 })?;
9785 __struct.time_boot_ms = buf.get_u32_le();
9786 __struct.time_manufacture_s = buf.get_u32_le();
9787 for v in &mut __struct.vendor_name {
9788 let val = buf.get_u8();
9789 *v = val;
9790 }
9791 for v in &mut __struct.model_name {
9792 let val = buf.get_u8();
9793 *v = val;
9794 }
9795 for v in &mut __struct.software_version {
9796 let val = buf.get_u8();
9797 *v = val;
9798 }
9799 for v in &mut __struct.hardware_version {
9800 let val = buf.get_u8();
9801 *v = val;
9802 }
9803 for v in &mut __struct.serial_number {
9804 let val = buf.get_u8();
9805 *v = val;
9806 }
9807 Ok(__struct)
9808 }
9809 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9810 let mut __tmp = BytesMut::new(bytes);
9811 #[allow(clippy::absurd_extreme_comparisons)]
9812 #[allow(unused_comparisons)]
9813 if __tmp.remaining() < Self::ENCODED_LEN {
9814 panic!(
9815 "buffer is too small (need {} bytes, but got {})",
9816 Self::ENCODED_LEN,
9817 __tmp.remaining(),
9818 )
9819 }
9820 __tmp.put_u64_le(self.capabilities.bits());
9821 __tmp.put_u32_le(self.time_boot_ms);
9822 __tmp.put_u32_le(self.time_manufacture_s);
9823 for val in &self.vendor_name {
9824 __tmp.put_u8(*val);
9825 }
9826 for val in &self.model_name {
9827 __tmp.put_u8(*val);
9828 }
9829 for val in &self.software_version {
9830 __tmp.put_u8(*val);
9831 }
9832 for val in &self.hardware_version {
9833 __tmp.put_u8(*val);
9834 }
9835 for val in &self.serial_number {
9836 __tmp.put_u8(*val);
9837 }
9838 if matches!(version, MavlinkVersion::V2) {
9839 let len = __tmp.len();
9840 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9841 } else {
9842 __tmp.len()
9843 }
9844 }
9845}
9846#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9847#[doc = ""]
9848#[doc = "ID: 397"]
9849#[derive(Debug, Clone, PartialEq)]
9850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9851#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9852#[cfg_attr(feature = "ts", derive(TS))]
9853#[cfg_attr(feature = "ts", ts(export))]
9854pub struct COMPONENT_METADATA_DATA {
9855 #[doc = "Timestamp (time since system boot)."]
9856 pub time_boot_ms: u32,
9857 #[doc = "CRC32 of the general metadata file."]
9858 pub file_crc: u32,
9859 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9860 #[cfg_attr(
9861 feature = "serde",
9862 serde(
9863 serialize_with = "crate::nulstr::serialize::<_, 100>",
9864 deserialize_with = "crate::nulstr::deserialize::<_, 100>"
9865 )
9866 )]
9867 #[cfg_attr(feature = "ts", ts(type = "string"))]
9868 pub uri: [u8; 100],
9869}
9870impl COMPONENT_METADATA_DATA {
9871 pub const ENCODED_LEN: usize = 108usize;
9872 pub const DEFAULT: Self = Self {
9873 time_boot_ms: 0_u32,
9874 file_crc: 0_u32,
9875 uri: [0_u8; 100usize],
9876 };
9877 #[cfg(feature = "arbitrary")]
9878 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9879 use arbitrary::{Arbitrary, Unstructured};
9880 let mut buf = [0u8; 1024];
9881 rng.fill_bytes(&mut buf);
9882 let mut unstructured = Unstructured::new(&buf);
9883 Self::arbitrary(&mut unstructured).unwrap_or_default()
9884 }
9885}
9886impl Default for COMPONENT_METADATA_DATA {
9887 fn default() -> Self {
9888 Self::DEFAULT.clone()
9889 }
9890}
9891impl MessageData for COMPONENT_METADATA_DATA {
9892 type Message = MavMessage;
9893 const ID: u32 = 397u32;
9894 const NAME: &'static str = "COMPONENT_METADATA";
9895 const EXTRA_CRC: u8 = 182u8;
9896 const ENCODED_LEN: usize = 108usize;
9897 fn deser(
9898 _version: MavlinkVersion,
9899 __input: &[u8],
9900 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9901 let avail_len = __input.len();
9902 let mut payload_buf = [0; Self::ENCODED_LEN];
9903 let mut buf = if avail_len < Self::ENCODED_LEN {
9904 payload_buf[0..avail_len].copy_from_slice(__input);
9905 Bytes::new(&payload_buf)
9906 } else {
9907 Bytes::new(__input)
9908 };
9909 let mut __struct = Self::default();
9910 __struct.time_boot_ms = buf.get_u32_le();
9911 __struct.file_crc = buf.get_u32_le();
9912 for v in &mut __struct.uri {
9913 let val = buf.get_u8();
9914 *v = val;
9915 }
9916 Ok(__struct)
9917 }
9918 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9919 let mut __tmp = BytesMut::new(bytes);
9920 #[allow(clippy::absurd_extreme_comparisons)]
9921 #[allow(unused_comparisons)]
9922 if __tmp.remaining() < Self::ENCODED_LEN {
9923 panic!(
9924 "buffer is too small (need {} bytes, but got {})",
9925 Self::ENCODED_LEN,
9926 __tmp.remaining(),
9927 )
9928 }
9929 __tmp.put_u32_le(self.time_boot_ms);
9930 __tmp.put_u32_le(self.file_crc);
9931 for val in &self.uri {
9932 __tmp.put_u8(*val);
9933 }
9934 if matches!(version, MavlinkVersion::V2) {
9935 let len = __tmp.len();
9936 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9937 } else {
9938 __tmp.len()
9939 }
9940 }
9941}
9942#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9943#[doc = ""]
9944#[doc = "ID: 146"]
9945#[derive(Debug, Clone, PartialEq)]
9946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9948#[cfg_attr(feature = "ts", derive(TS))]
9949#[cfg_attr(feature = "ts", ts(export))]
9950pub struct CONTROL_SYSTEM_STATE_DATA {
9951 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9952 pub time_usec: u64,
9953 #[doc = "X acceleration in body frame"]
9954 pub x_acc: f32,
9955 #[doc = "Y acceleration in body frame"]
9956 pub y_acc: f32,
9957 #[doc = "Z acceleration in body frame"]
9958 pub z_acc: f32,
9959 #[doc = "X velocity in body frame"]
9960 pub x_vel: f32,
9961 #[doc = "Y velocity in body frame"]
9962 pub y_vel: f32,
9963 #[doc = "Z velocity in body frame"]
9964 pub z_vel: f32,
9965 #[doc = "X position in local frame"]
9966 pub x_pos: f32,
9967 #[doc = "Y position in local frame"]
9968 pub y_pos: f32,
9969 #[doc = "Z position in local frame"]
9970 pub z_pos: f32,
9971 #[doc = "Airspeed, set to -1 if unknown"]
9972 pub airspeed: f32,
9973 #[doc = "Variance of body velocity estimate"]
9974 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9975 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9976 pub vel_variance: [f32; 3],
9977 #[doc = "Variance in local position"]
9978 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9979 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9980 pub pos_variance: [f32; 3],
9981 #[doc = "The attitude, represented as Quaternion"]
9982 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9983 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9984 pub q: [f32; 4],
9985 #[doc = "Angular rate in roll axis"]
9986 pub roll_rate: f32,
9987 #[doc = "Angular rate in pitch axis"]
9988 pub pitch_rate: f32,
9989 #[doc = "Angular rate in yaw axis"]
9990 pub yaw_rate: f32,
9991}
9992impl CONTROL_SYSTEM_STATE_DATA {
9993 pub const ENCODED_LEN: usize = 100usize;
9994 pub const DEFAULT: Self = Self {
9995 time_usec: 0_u64,
9996 x_acc: 0.0_f32,
9997 y_acc: 0.0_f32,
9998 z_acc: 0.0_f32,
9999 x_vel: 0.0_f32,
10000 y_vel: 0.0_f32,
10001 z_vel: 0.0_f32,
10002 x_pos: 0.0_f32,
10003 y_pos: 0.0_f32,
10004 z_pos: 0.0_f32,
10005 airspeed: 0.0_f32,
10006 vel_variance: [0.0_f32; 3usize],
10007 pos_variance: [0.0_f32; 3usize],
10008 q: [0.0_f32; 4usize],
10009 roll_rate: 0.0_f32,
10010 pitch_rate: 0.0_f32,
10011 yaw_rate: 0.0_f32,
10012 };
10013 #[cfg(feature = "arbitrary")]
10014 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10015 use arbitrary::{Arbitrary, Unstructured};
10016 let mut buf = [0u8; 1024];
10017 rng.fill_bytes(&mut buf);
10018 let mut unstructured = Unstructured::new(&buf);
10019 Self::arbitrary(&mut unstructured).unwrap_or_default()
10020 }
10021}
10022impl Default for CONTROL_SYSTEM_STATE_DATA {
10023 fn default() -> Self {
10024 Self::DEFAULT.clone()
10025 }
10026}
10027impl MessageData for CONTROL_SYSTEM_STATE_DATA {
10028 type Message = MavMessage;
10029 const ID: u32 = 146u32;
10030 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
10031 const EXTRA_CRC: u8 = 103u8;
10032 const ENCODED_LEN: usize = 100usize;
10033 fn deser(
10034 _version: MavlinkVersion,
10035 __input: &[u8],
10036 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10037 let avail_len = __input.len();
10038 let mut payload_buf = [0; Self::ENCODED_LEN];
10039 let mut buf = if avail_len < Self::ENCODED_LEN {
10040 payload_buf[0..avail_len].copy_from_slice(__input);
10041 Bytes::new(&payload_buf)
10042 } else {
10043 Bytes::new(__input)
10044 };
10045 let mut __struct = Self::default();
10046 __struct.time_usec = buf.get_u64_le();
10047 __struct.x_acc = buf.get_f32_le();
10048 __struct.y_acc = buf.get_f32_le();
10049 __struct.z_acc = buf.get_f32_le();
10050 __struct.x_vel = buf.get_f32_le();
10051 __struct.y_vel = buf.get_f32_le();
10052 __struct.z_vel = buf.get_f32_le();
10053 __struct.x_pos = buf.get_f32_le();
10054 __struct.y_pos = buf.get_f32_le();
10055 __struct.z_pos = buf.get_f32_le();
10056 __struct.airspeed = buf.get_f32_le();
10057 for v in &mut __struct.vel_variance {
10058 let val = buf.get_f32_le();
10059 *v = val;
10060 }
10061 for v in &mut __struct.pos_variance {
10062 let val = buf.get_f32_le();
10063 *v = val;
10064 }
10065 for v in &mut __struct.q {
10066 let val = buf.get_f32_le();
10067 *v = val;
10068 }
10069 __struct.roll_rate = buf.get_f32_le();
10070 __struct.pitch_rate = buf.get_f32_le();
10071 __struct.yaw_rate = buf.get_f32_le();
10072 Ok(__struct)
10073 }
10074 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10075 let mut __tmp = BytesMut::new(bytes);
10076 #[allow(clippy::absurd_extreme_comparisons)]
10077 #[allow(unused_comparisons)]
10078 if __tmp.remaining() < Self::ENCODED_LEN {
10079 panic!(
10080 "buffer is too small (need {} bytes, but got {})",
10081 Self::ENCODED_LEN,
10082 __tmp.remaining(),
10083 )
10084 }
10085 __tmp.put_u64_le(self.time_usec);
10086 __tmp.put_f32_le(self.x_acc);
10087 __tmp.put_f32_le(self.y_acc);
10088 __tmp.put_f32_le(self.z_acc);
10089 __tmp.put_f32_le(self.x_vel);
10090 __tmp.put_f32_le(self.y_vel);
10091 __tmp.put_f32_le(self.z_vel);
10092 __tmp.put_f32_le(self.x_pos);
10093 __tmp.put_f32_le(self.y_pos);
10094 __tmp.put_f32_le(self.z_pos);
10095 __tmp.put_f32_le(self.airspeed);
10096 for val in &self.vel_variance {
10097 __tmp.put_f32_le(*val);
10098 }
10099 for val in &self.pos_variance {
10100 __tmp.put_f32_le(*val);
10101 }
10102 for val in &self.q {
10103 __tmp.put_f32_le(*val);
10104 }
10105 __tmp.put_f32_le(self.roll_rate);
10106 __tmp.put_f32_le(self.pitch_rate);
10107 __tmp.put_f32_le(self.yaw_rate);
10108 if matches!(version, MavlinkVersion::V2) {
10109 let len = __tmp.len();
10110 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10111 } else {
10112 __tmp.len()
10113 }
10114 }
10115}
10116#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10117#[doc = ""]
10118#[doc = "ID: 411"]
10119#[derive(Debug, Clone, PartialEq)]
10120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10121#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10122#[cfg_attr(feature = "ts", derive(TS))]
10123#[cfg_attr(feature = "ts", ts(export))]
10124pub struct CURRENT_EVENT_SEQUENCE_DATA {
10125 #[doc = "Sequence number."]
10126 pub sequence: u16,
10127 #[doc = "Flag bitset."]
10128 pub flags: MavEventCurrentSequenceFlags,
10129}
10130impl CURRENT_EVENT_SEQUENCE_DATA {
10131 pub const ENCODED_LEN: usize = 3usize;
10132 pub const DEFAULT: Self = Self {
10133 sequence: 0_u16,
10134 flags: MavEventCurrentSequenceFlags::DEFAULT,
10135 };
10136 #[cfg(feature = "arbitrary")]
10137 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10138 use arbitrary::{Arbitrary, Unstructured};
10139 let mut buf = [0u8; 1024];
10140 rng.fill_bytes(&mut buf);
10141 let mut unstructured = Unstructured::new(&buf);
10142 Self::arbitrary(&mut unstructured).unwrap_or_default()
10143 }
10144}
10145impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10146 fn default() -> Self {
10147 Self::DEFAULT.clone()
10148 }
10149}
10150impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10151 type Message = MavMessage;
10152 const ID: u32 = 411u32;
10153 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10154 const EXTRA_CRC: u8 = 106u8;
10155 const ENCODED_LEN: usize = 3usize;
10156 fn deser(
10157 _version: MavlinkVersion,
10158 __input: &[u8],
10159 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10160 let avail_len = __input.len();
10161 let mut payload_buf = [0; Self::ENCODED_LEN];
10162 let mut buf = if avail_len < Self::ENCODED_LEN {
10163 payload_buf[0..avail_len].copy_from_slice(__input);
10164 Bytes::new(&payload_buf)
10165 } else {
10166 Bytes::new(__input)
10167 };
10168 let mut __struct = Self::default();
10169 __struct.sequence = buf.get_u16_le();
10170 let tmp = buf.get_u8();
10171 __struct.flags =
10172 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10173 enum_type: "MavEventCurrentSequenceFlags",
10174 value: tmp as u32,
10175 })?;
10176 Ok(__struct)
10177 }
10178 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10179 let mut __tmp = BytesMut::new(bytes);
10180 #[allow(clippy::absurd_extreme_comparisons)]
10181 #[allow(unused_comparisons)]
10182 if __tmp.remaining() < Self::ENCODED_LEN {
10183 panic!(
10184 "buffer is too small (need {} bytes, but got {})",
10185 Self::ENCODED_LEN,
10186 __tmp.remaining(),
10187 )
10188 }
10189 __tmp.put_u16_le(self.sequence);
10190 __tmp.put_u8(self.flags as u8);
10191 if matches!(version, MavlinkVersion::V2) {
10192 let len = __tmp.len();
10193 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10194 } else {
10195 __tmp.len()
10196 }
10197 }
10198}
10199#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10200#[doc = ""]
10201#[doc = "ID: 436"]
10202#[derive(Debug, Clone, PartialEq)]
10203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10204#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10205#[cfg_attr(feature = "ts", derive(TS))]
10206#[cfg_attr(feature = "ts", ts(export))]
10207pub struct CURRENT_MODE_DATA {
10208 #[doc = "A bitfield for use for autopilot-specific flags"]
10209 pub custom_mode: u32,
10210 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10211 pub intended_custom_mode: u32,
10212 #[doc = "Standard mode."]
10213 pub standard_mode: MavStandardMode,
10214}
10215impl CURRENT_MODE_DATA {
10216 pub const ENCODED_LEN: usize = 9usize;
10217 pub const DEFAULT: Self = Self {
10218 custom_mode: 0_u32,
10219 intended_custom_mode: 0_u32,
10220 standard_mode: MavStandardMode::DEFAULT,
10221 };
10222 #[cfg(feature = "arbitrary")]
10223 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10224 use arbitrary::{Arbitrary, Unstructured};
10225 let mut buf = [0u8; 1024];
10226 rng.fill_bytes(&mut buf);
10227 let mut unstructured = Unstructured::new(&buf);
10228 Self::arbitrary(&mut unstructured).unwrap_or_default()
10229 }
10230}
10231impl Default for CURRENT_MODE_DATA {
10232 fn default() -> Self {
10233 Self::DEFAULT.clone()
10234 }
10235}
10236impl MessageData for CURRENT_MODE_DATA {
10237 type Message = MavMessage;
10238 const ID: u32 = 436u32;
10239 const NAME: &'static str = "CURRENT_MODE";
10240 const EXTRA_CRC: u8 = 193u8;
10241 const ENCODED_LEN: usize = 9usize;
10242 fn deser(
10243 _version: MavlinkVersion,
10244 __input: &[u8],
10245 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10246 let avail_len = __input.len();
10247 let mut payload_buf = [0; Self::ENCODED_LEN];
10248 let mut buf = if avail_len < Self::ENCODED_LEN {
10249 payload_buf[0..avail_len].copy_from_slice(__input);
10250 Bytes::new(&payload_buf)
10251 } else {
10252 Bytes::new(__input)
10253 };
10254 let mut __struct = Self::default();
10255 __struct.custom_mode = buf.get_u32_le();
10256 __struct.intended_custom_mode = buf.get_u32_le();
10257 let tmp = buf.get_u8();
10258 __struct.standard_mode =
10259 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10260 enum_type: "MavStandardMode",
10261 value: tmp as u32,
10262 })?;
10263 Ok(__struct)
10264 }
10265 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10266 let mut __tmp = BytesMut::new(bytes);
10267 #[allow(clippy::absurd_extreme_comparisons)]
10268 #[allow(unused_comparisons)]
10269 if __tmp.remaining() < Self::ENCODED_LEN {
10270 panic!(
10271 "buffer is too small (need {} bytes, but got {})",
10272 Self::ENCODED_LEN,
10273 __tmp.remaining(),
10274 )
10275 }
10276 __tmp.put_u32_le(self.custom_mode);
10277 __tmp.put_u32_le(self.intended_custom_mode);
10278 __tmp.put_u8(self.standard_mode as u8);
10279 if matches!(version, MavlinkVersion::V2) {
10280 let len = __tmp.len();
10281 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10282 } else {
10283 __tmp.len()
10284 }
10285 }
10286}
10287#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10288#[doc = "Data stream status information."]
10289#[doc = ""]
10290#[doc = "ID: 67"]
10291#[derive(Debug, Clone, PartialEq)]
10292#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10294#[cfg_attr(feature = "ts", derive(TS))]
10295#[cfg_attr(feature = "ts", ts(export))]
10296pub struct DATA_STREAM_DATA {
10297 #[doc = "The message rate"]
10298 pub message_rate: u16,
10299 #[doc = "The ID of the requested data stream"]
10300 pub stream_id: u8,
10301 #[doc = "1 stream is enabled, 0 stream is stopped."]
10302 pub on_off: u8,
10303}
10304impl DATA_STREAM_DATA {
10305 pub const ENCODED_LEN: usize = 4usize;
10306 pub const DEFAULT: Self = Self {
10307 message_rate: 0_u16,
10308 stream_id: 0_u8,
10309 on_off: 0_u8,
10310 };
10311 #[cfg(feature = "arbitrary")]
10312 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10313 use arbitrary::{Arbitrary, Unstructured};
10314 let mut buf = [0u8; 1024];
10315 rng.fill_bytes(&mut buf);
10316 let mut unstructured = Unstructured::new(&buf);
10317 Self::arbitrary(&mut unstructured).unwrap_or_default()
10318 }
10319}
10320impl Default for DATA_STREAM_DATA {
10321 fn default() -> Self {
10322 Self::DEFAULT.clone()
10323 }
10324}
10325impl MessageData for DATA_STREAM_DATA {
10326 type Message = MavMessage;
10327 const ID: u32 = 67u32;
10328 const NAME: &'static str = "DATA_STREAM";
10329 const EXTRA_CRC: u8 = 21u8;
10330 const ENCODED_LEN: usize = 4usize;
10331 fn deser(
10332 _version: MavlinkVersion,
10333 __input: &[u8],
10334 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10335 let avail_len = __input.len();
10336 let mut payload_buf = [0; Self::ENCODED_LEN];
10337 let mut buf = if avail_len < Self::ENCODED_LEN {
10338 payload_buf[0..avail_len].copy_from_slice(__input);
10339 Bytes::new(&payload_buf)
10340 } else {
10341 Bytes::new(__input)
10342 };
10343 let mut __struct = Self::default();
10344 __struct.message_rate = buf.get_u16_le();
10345 __struct.stream_id = buf.get_u8();
10346 __struct.on_off = buf.get_u8();
10347 Ok(__struct)
10348 }
10349 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10350 let mut __tmp = BytesMut::new(bytes);
10351 #[allow(clippy::absurd_extreme_comparisons)]
10352 #[allow(unused_comparisons)]
10353 if __tmp.remaining() < Self::ENCODED_LEN {
10354 panic!(
10355 "buffer is too small (need {} bytes, but got {})",
10356 Self::ENCODED_LEN,
10357 __tmp.remaining(),
10358 )
10359 }
10360 __tmp.put_u16_le(self.message_rate);
10361 __tmp.put_u8(self.stream_id);
10362 __tmp.put_u8(self.on_off);
10363 if matches!(version, MavlinkVersion::V2) {
10364 let len = __tmp.len();
10365 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10366 } else {
10367 __tmp.len()
10368 }
10369 }
10370}
10371#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10372#[doc = ""]
10373#[doc = "ID: 130"]
10374#[derive(Debug, Clone, PartialEq)]
10375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10377#[cfg_attr(feature = "ts", derive(TS))]
10378#[cfg_attr(feature = "ts", ts(export))]
10379pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10380 #[doc = "total data size (set on ACK only)."]
10381 pub size: u32,
10382 #[doc = "Width of a matrix or image."]
10383 pub width: u16,
10384 #[doc = "Height of a matrix or image."]
10385 pub height: u16,
10386 #[doc = "Number of packets being sent (set on ACK only)."]
10387 pub packets: u16,
10388 #[doc = "Type of requested/acknowledged data."]
10389 pub mavtype: MavlinkDataStreamType,
10390 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10391 pub payload: u8,
10392 #[doc = "JPEG quality. Values: [1-100]."]
10393 pub jpg_quality: u8,
10394}
10395impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10396 pub const ENCODED_LEN: usize = 13usize;
10397 pub const DEFAULT: Self = Self {
10398 size: 0_u32,
10399 width: 0_u16,
10400 height: 0_u16,
10401 packets: 0_u16,
10402 mavtype: MavlinkDataStreamType::DEFAULT,
10403 payload: 0_u8,
10404 jpg_quality: 0_u8,
10405 };
10406 #[cfg(feature = "arbitrary")]
10407 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10408 use arbitrary::{Arbitrary, Unstructured};
10409 let mut buf = [0u8; 1024];
10410 rng.fill_bytes(&mut buf);
10411 let mut unstructured = Unstructured::new(&buf);
10412 Self::arbitrary(&mut unstructured).unwrap_or_default()
10413 }
10414}
10415impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10416 fn default() -> Self {
10417 Self::DEFAULT.clone()
10418 }
10419}
10420impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10421 type Message = MavMessage;
10422 const ID: u32 = 130u32;
10423 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10424 const EXTRA_CRC: u8 = 29u8;
10425 const ENCODED_LEN: usize = 13usize;
10426 fn deser(
10427 _version: MavlinkVersion,
10428 __input: &[u8],
10429 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10430 let avail_len = __input.len();
10431 let mut payload_buf = [0; Self::ENCODED_LEN];
10432 let mut buf = if avail_len < Self::ENCODED_LEN {
10433 payload_buf[0..avail_len].copy_from_slice(__input);
10434 Bytes::new(&payload_buf)
10435 } else {
10436 Bytes::new(__input)
10437 };
10438 let mut __struct = Self::default();
10439 __struct.size = buf.get_u32_le();
10440 __struct.width = buf.get_u16_le();
10441 __struct.height = buf.get_u16_le();
10442 __struct.packets = buf.get_u16_le();
10443 let tmp = buf.get_u8();
10444 __struct.mavtype =
10445 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10446 enum_type: "MavlinkDataStreamType",
10447 value: tmp as u32,
10448 })?;
10449 __struct.payload = buf.get_u8();
10450 __struct.jpg_quality = buf.get_u8();
10451 Ok(__struct)
10452 }
10453 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10454 let mut __tmp = BytesMut::new(bytes);
10455 #[allow(clippy::absurd_extreme_comparisons)]
10456 #[allow(unused_comparisons)]
10457 if __tmp.remaining() < Self::ENCODED_LEN {
10458 panic!(
10459 "buffer is too small (need {} bytes, but got {})",
10460 Self::ENCODED_LEN,
10461 __tmp.remaining(),
10462 )
10463 }
10464 __tmp.put_u32_le(self.size);
10465 __tmp.put_u16_le(self.width);
10466 __tmp.put_u16_le(self.height);
10467 __tmp.put_u16_le(self.packets);
10468 __tmp.put_u8(self.mavtype as u8);
10469 __tmp.put_u8(self.payload);
10470 __tmp.put_u8(self.jpg_quality);
10471 if matches!(version, MavlinkVersion::V2) {
10472 let len = __tmp.len();
10473 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10474 } else {
10475 __tmp.len()
10476 }
10477 }
10478}
10479#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10480#[doc = ""]
10481#[doc = "ID: 254"]
10482#[derive(Debug, Clone, PartialEq)]
10483#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10484#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10485#[cfg_attr(feature = "ts", derive(TS))]
10486#[cfg_attr(feature = "ts", ts(export))]
10487pub struct DEBUG_DATA {
10488 #[doc = "Timestamp (time since system boot)."]
10489 pub time_boot_ms: u32,
10490 #[doc = "DEBUG value"]
10491 pub value: f32,
10492 #[doc = "index of debug variable"]
10493 pub ind: u8,
10494}
10495impl DEBUG_DATA {
10496 pub const ENCODED_LEN: usize = 9usize;
10497 pub const DEFAULT: Self = Self {
10498 time_boot_ms: 0_u32,
10499 value: 0.0_f32,
10500 ind: 0_u8,
10501 };
10502 #[cfg(feature = "arbitrary")]
10503 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10504 use arbitrary::{Arbitrary, Unstructured};
10505 let mut buf = [0u8; 1024];
10506 rng.fill_bytes(&mut buf);
10507 let mut unstructured = Unstructured::new(&buf);
10508 Self::arbitrary(&mut unstructured).unwrap_or_default()
10509 }
10510}
10511impl Default for DEBUG_DATA {
10512 fn default() -> Self {
10513 Self::DEFAULT.clone()
10514 }
10515}
10516impl MessageData for DEBUG_DATA {
10517 type Message = MavMessage;
10518 const ID: u32 = 254u32;
10519 const NAME: &'static str = "DEBUG";
10520 const EXTRA_CRC: u8 = 46u8;
10521 const ENCODED_LEN: usize = 9usize;
10522 fn deser(
10523 _version: MavlinkVersion,
10524 __input: &[u8],
10525 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10526 let avail_len = __input.len();
10527 let mut payload_buf = [0; Self::ENCODED_LEN];
10528 let mut buf = if avail_len < Self::ENCODED_LEN {
10529 payload_buf[0..avail_len].copy_from_slice(__input);
10530 Bytes::new(&payload_buf)
10531 } else {
10532 Bytes::new(__input)
10533 };
10534 let mut __struct = Self::default();
10535 __struct.time_boot_ms = buf.get_u32_le();
10536 __struct.value = buf.get_f32_le();
10537 __struct.ind = buf.get_u8();
10538 Ok(__struct)
10539 }
10540 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10541 let mut __tmp = BytesMut::new(bytes);
10542 #[allow(clippy::absurd_extreme_comparisons)]
10543 #[allow(unused_comparisons)]
10544 if __tmp.remaining() < Self::ENCODED_LEN {
10545 panic!(
10546 "buffer is too small (need {} bytes, but got {})",
10547 Self::ENCODED_LEN,
10548 __tmp.remaining(),
10549 )
10550 }
10551 __tmp.put_u32_le(self.time_boot_ms);
10552 __tmp.put_f32_le(self.value);
10553 __tmp.put_u8(self.ind);
10554 if matches!(version, MavlinkVersion::V2) {
10555 let len = __tmp.len();
10556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10557 } else {
10558 __tmp.len()
10559 }
10560 }
10561}
10562#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10563#[doc = ""]
10564#[doc = "ID: 350"]
10565#[derive(Debug, Clone, PartialEq)]
10566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10568#[cfg_attr(feature = "ts", derive(TS))]
10569#[cfg_attr(feature = "ts", ts(export))]
10570pub struct DEBUG_FLOAT_ARRAY_DATA {
10571 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10572 pub time_usec: u64,
10573 #[doc = "Unique ID used to discriminate between arrays"]
10574 pub array_id: u16,
10575 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10576 #[cfg_attr(
10577 feature = "serde",
10578 serde(
10579 serialize_with = "crate::nulstr::serialize::<_, 10>",
10580 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
10581 )
10582 )]
10583 #[cfg_attr(feature = "ts", ts(type = "string"))]
10584 pub name: [u8; 10],
10585 #[doc = "data"]
10586 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10587 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10588 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10589 pub data: [f32; 58],
10590}
10591impl DEBUG_FLOAT_ARRAY_DATA {
10592 pub const ENCODED_LEN: usize = 252usize;
10593 pub const DEFAULT: Self = Self {
10594 time_usec: 0_u64,
10595 array_id: 0_u16,
10596 name: [0_u8; 10usize],
10597 data: [0.0_f32; 58usize],
10598 };
10599 #[cfg(feature = "arbitrary")]
10600 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10601 use arbitrary::{Arbitrary, Unstructured};
10602 let mut buf = [0u8; 1024];
10603 rng.fill_bytes(&mut buf);
10604 let mut unstructured = Unstructured::new(&buf);
10605 Self::arbitrary(&mut unstructured).unwrap_or_default()
10606 }
10607}
10608impl Default for DEBUG_FLOAT_ARRAY_DATA {
10609 fn default() -> Self {
10610 Self::DEFAULT.clone()
10611 }
10612}
10613impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10614 type Message = MavMessage;
10615 const ID: u32 = 350u32;
10616 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10617 const EXTRA_CRC: u8 = 232u8;
10618 const ENCODED_LEN: usize = 252usize;
10619 fn deser(
10620 _version: MavlinkVersion,
10621 __input: &[u8],
10622 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10623 let avail_len = __input.len();
10624 let mut payload_buf = [0; Self::ENCODED_LEN];
10625 let mut buf = if avail_len < Self::ENCODED_LEN {
10626 payload_buf[0..avail_len].copy_from_slice(__input);
10627 Bytes::new(&payload_buf)
10628 } else {
10629 Bytes::new(__input)
10630 };
10631 let mut __struct = Self::default();
10632 __struct.time_usec = buf.get_u64_le();
10633 __struct.array_id = buf.get_u16_le();
10634 for v in &mut __struct.name {
10635 let val = buf.get_u8();
10636 *v = val;
10637 }
10638 for v in &mut __struct.data {
10639 let val = buf.get_f32_le();
10640 *v = val;
10641 }
10642 Ok(__struct)
10643 }
10644 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10645 let mut __tmp = BytesMut::new(bytes);
10646 #[allow(clippy::absurd_extreme_comparisons)]
10647 #[allow(unused_comparisons)]
10648 if __tmp.remaining() < Self::ENCODED_LEN {
10649 panic!(
10650 "buffer is too small (need {} bytes, but got {})",
10651 Self::ENCODED_LEN,
10652 __tmp.remaining(),
10653 )
10654 }
10655 __tmp.put_u64_le(self.time_usec);
10656 __tmp.put_u16_le(self.array_id);
10657 for val in &self.name {
10658 __tmp.put_u8(*val);
10659 }
10660 if matches!(version, MavlinkVersion::V2) {
10661 for val in &self.data {
10662 __tmp.put_f32_le(*val);
10663 }
10664 let len = __tmp.len();
10665 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10666 } else {
10667 __tmp.len()
10668 }
10669 }
10670}
10671#[doc = "To debug something using a named 3D vector."]
10672#[doc = ""]
10673#[doc = "ID: 250"]
10674#[derive(Debug, Clone, PartialEq)]
10675#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10676#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10677#[cfg_attr(feature = "ts", derive(TS))]
10678#[cfg_attr(feature = "ts", ts(export))]
10679pub struct DEBUG_VECT_DATA {
10680 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10681 pub time_usec: u64,
10682 #[doc = "x"]
10683 pub x: f32,
10684 #[doc = "y"]
10685 pub y: f32,
10686 #[doc = "z"]
10687 pub z: f32,
10688 #[doc = "Name"]
10689 #[cfg_attr(
10690 feature = "serde",
10691 serde(
10692 serialize_with = "crate::nulstr::serialize::<_, 10>",
10693 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
10694 )
10695 )]
10696 #[cfg_attr(feature = "ts", ts(type = "string"))]
10697 pub name: [u8; 10],
10698}
10699impl DEBUG_VECT_DATA {
10700 pub const ENCODED_LEN: usize = 30usize;
10701 pub const DEFAULT: Self = Self {
10702 time_usec: 0_u64,
10703 x: 0.0_f32,
10704 y: 0.0_f32,
10705 z: 0.0_f32,
10706 name: [0_u8; 10usize],
10707 };
10708 #[cfg(feature = "arbitrary")]
10709 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10710 use arbitrary::{Arbitrary, Unstructured};
10711 let mut buf = [0u8; 1024];
10712 rng.fill_bytes(&mut buf);
10713 let mut unstructured = Unstructured::new(&buf);
10714 Self::arbitrary(&mut unstructured).unwrap_or_default()
10715 }
10716}
10717impl Default for DEBUG_VECT_DATA {
10718 fn default() -> Self {
10719 Self::DEFAULT.clone()
10720 }
10721}
10722impl MessageData for DEBUG_VECT_DATA {
10723 type Message = MavMessage;
10724 const ID: u32 = 250u32;
10725 const NAME: &'static str = "DEBUG_VECT";
10726 const EXTRA_CRC: u8 = 49u8;
10727 const ENCODED_LEN: usize = 30usize;
10728 fn deser(
10729 _version: MavlinkVersion,
10730 __input: &[u8],
10731 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10732 let avail_len = __input.len();
10733 let mut payload_buf = [0; Self::ENCODED_LEN];
10734 let mut buf = if avail_len < Self::ENCODED_LEN {
10735 payload_buf[0..avail_len].copy_from_slice(__input);
10736 Bytes::new(&payload_buf)
10737 } else {
10738 Bytes::new(__input)
10739 };
10740 let mut __struct = Self::default();
10741 __struct.time_usec = buf.get_u64_le();
10742 __struct.x = buf.get_f32_le();
10743 __struct.y = buf.get_f32_le();
10744 __struct.z = buf.get_f32_le();
10745 for v in &mut __struct.name {
10746 let val = buf.get_u8();
10747 *v = val;
10748 }
10749 Ok(__struct)
10750 }
10751 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10752 let mut __tmp = BytesMut::new(bytes);
10753 #[allow(clippy::absurd_extreme_comparisons)]
10754 #[allow(unused_comparisons)]
10755 if __tmp.remaining() < Self::ENCODED_LEN {
10756 panic!(
10757 "buffer is too small (need {} bytes, but got {})",
10758 Self::ENCODED_LEN,
10759 __tmp.remaining(),
10760 )
10761 }
10762 __tmp.put_u64_le(self.time_usec);
10763 __tmp.put_f32_le(self.x);
10764 __tmp.put_f32_le(self.y);
10765 __tmp.put_f32_le(self.z);
10766 for val in &self.name {
10767 __tmp.put_u8(*val);
10768 }
10769 if matches!(version, MavlinkVersion::V2) {
10770 let len = __tmp.len();
10771 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10772 } else {
10773 __tmp.len()
10774 }
10775 }
10776}
10777#[doc = "Distance sensor information for an onboard rangefinder."]
10778#[doc = ""]
10779#[doc = "ID: 132"]
10780#[derive(Debug, Clone, PartialEq)]
10781#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10782#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10783#[cfg_attr(feature = "ts", derive(TS))]
10784#[cfg_attr(feature = "ts", ts(export))]
10785pub struct DISTANCE_SENSOR_DATA {
10786 #[doc = "Timestamp (time since system boot)."]
10787 pub time_boot_ms: u32,
10788 #[doc = "Minimum distance the sensor can measure"]
10789 pub min_distance: u16,
10790 #[doc = "Maximum distance the sensor can measure"]
10791 pub max_distance: u16,
10792 #[doc = "Current distance reading"]
10793 pub current_distance: u16,
10794 #[doc = "Type of distance sensor."]
10795 pub mavtype: MavDistanceSensor,
10796 #[doc = "Onboard ID of the sensor"]
10797 pub id: u8,
10798 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10799 pub orientation: MavSensorOrientation,
10800 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10801 pub covariance: u8,
10802 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10803 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10804 pub horizontal_fov: f32,
10805 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10806 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10807 pub vertical_fov: f32,
10808 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10809 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10810 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10811 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10812 pub quaternion: [f32; 4],
10813 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10814 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10815 pub signal_quality: u8,
10816}
10817impl DISTANCE_SENSOR_DATA {
10818 pub const ENCODED_LEN: usize = 39usize;
10819 pub const DEFAULT: Self = Self {
10820 time_boot_ms: 0_u32,
10821 min_distance: 0_u16,
10822 max_distance: 0_u16,
10823 current_distance: 0_u16,
10824 mavtype: MavDistanceSensor::DEFAULT,
10825 id: 0_u8,
10826 orientation: MavSensorOrientation::DEFAULT,
10827 covariance: 0_u8,
10828 horizontal_fov: 0.0_f32,
10829 vertical_fov: 0.0_f32,
10830 quaternion: [0.0_f32; 4usize],
10831 signal_quality: 0_u8,
10832 };
10833 #[cfg(feature = "arbitrary")]
10834 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10835 use arbitrary::{Arbitrary, Unstructured};
10836 let mut buf = [0u8; 1024];
10837 rng.fill_bytes(&mut buf);
10838 let mut unstructured = Unstructured::new(&buf);
10839 Self::arbitrary(&mut unstructured).unwrap_or_default()
10840 }
10841}
10842impl Default for DISTANCE_SENSOR_DATA {
10843 fn default() -> Self {
10844 Self::DEFAULT.clone()
10845 }
10846}
10847impl MessageData for DISTANCE_SENSOR_DATA {
10848 type Message = MavMessage;
10849 const ID: u32 = 132u32;
10850 const NAME: &'static str = "DISTANCE_SENSOR";
10851 const EXTRA_CRC: u8 = 85u8;
10852 const ENCODED_LEN: usize = 39usize;
10853 fn deser(
10854 _version: MavlinkVersion,
10855 __input: &[u8],
10856 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10857 let avail_len = __input.len();
10858 let mut payload_buf = [0; Self::ENCODED_LEN];
10859 let mut buf = if avail_len < Self::ENCODED_LEN {
10860 payload_buf[0..avail_len].copy_from_slice(__input);
10861 Bytes::new(&payload_buf)
10862 } else {
10863 Bytes::new(__input)
10864 };
10865 let mut __struct = Self::default();
10866 __struct.time_boot_ms = buf.get_u32_le();
10867 __struct.min_distance = buf.get_u16_le();
10868 __struct.max_distance = buf.get_u16_le();
10869 __struct.current_distance = buf.get_u16_le();
10870 let tmp = buf.get_u8();
10871 __struct.mavtype =
10872 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10873 enum_type: "MavDistanceSensor",
10874 value: tmp as u32,
10875 })?;
10876 __struct.id = buf.get_u8();
10877 let tmp = buf.get_u8();
10878 __struct.orientation =
10879 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10880 enum_type: "MavSensorOrientation",
10881 value: tmp as u32,
10882 })?;
10883 __struct.covariance = buf.get_u8();
10884 __struct.horizontal_fov = buf.get_f32_le();
10885 __struct.vertical_fov = buf.get_f32_le();
10886 for v in &mut __struct.quaternion {
10887 let val = buf.get_f32_le();
10888 *v = val;
10889 }
10890 __struct.signal_quality = buf.get_u8();
10891 Ok(__struct)
10892 }
10893 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10894 let mut __tmp = BytesMut::new(bytes);
10895 #[allow(clippy::absurd_extreme_comparisons)]
10896 #[allow(unused_comparisons)]
10897 if __tmp.remaining() < Self::ENCODED_LEN {
10898 panic!(
10899 "buffer is too small (need {} bytes, but got {})",
10900 Self::ENCODED_LEN,
10901 __tmp.remaining(),
10902 )
10903 }
10904 __tmp.put_u32_le(self.time_boot_ms);
10905 __tmp.put_u16_le(self.min_distance);
10906 __tmp.put_u16_le(self.max_distance);
10907 __tmp.put_u16_le(self.current_distance);
10908 __tmp.put_u8(self.mavtype as u8);
10909 __tmp.put_u8(self.id);
10910 __tmp.put_u8(self.orientation as u8);
10911 __tmp.put_u8(self.covariance);
10912 if matches!(version, MavlinkVersion::V2) {
10913 __tmp.put_f32_le(self.horizontal_fov);
10914 __tmp.put_f32_le(self.vertical_fov);
10915 for val in &self.quaternion {
10916 __tmp.put_f32_le(*val);
10917 }
10918 __tmp.put_u8(self.signal_quality);
10919 let len = __tmp.len();
10920 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10921 } else {
10922 __tmp.len()
10923 }
10924 }
10925}
10926#[doc = "EFI status output."]
10927#[doc = ""]
10928#[doc = "ID: 225"]
10929#[derive(Debug, Clone, PartialEq)]
10930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10932#[cfg_attr(feature = "ts", derive(TS))]
10933#[cfg_attr(feature = "ts", ts(export))]
10934pub struct EFI_STATUS_DATA {
10935 #[doc = "ECU index"]
10936 pub ecu_index: f32,
10937 #[doc = "RPM"]
10938 pub rpm: f32,
10939 #[doc = "Fuel consumed"]
10940 pub fuel_consumed: f32,
10941 #[doc = "Fuel flow rate"]
10942 pub fuel_flow: f32,
10943 #[doc = "Engine load"]
10944 pub engine_load: f32,
10945 #[doc = "Throttle position"]
10946 pub throttle_position: f32,
10947 #[doc = "Spark dwell time"]
10948 pub spark_dwell_time: f32,
10949 #[doc = "Barometric pressure"]
10950 pub barometric_pressure: f32,
10951 #[doc = "Intake manifold pressure("]
10952 pub intake_manifold_pressure: f32,
10953 #[doc = "Intake manifold temperature"]
10954 pub intake_manifold_temperature: f32,
10955 #[doc = "Cylinder head temperature"]
10956 pub cylinder_head_temperature: f32,
10957 #[doc = "Ignition timing (Crank angle degrees)"]
10958 pub ignition_timing: f32,
10959 #[doc = "Injection time"]
10960 pub injection_time: f32,
10961 #[doc = "Exhaust gas temperature"]
10962 pub exhaust_gas_temperature: f32,
10963 #[doc = "Output throttle"]
10964 pub throttle_out: f32,
10965 #[doc = "Pressure/temperature compensation"]
10966 pub pt_compensation: f32,
10967 #[doc = "EFI health status"]
10968 pub health: u8,
10969 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10970 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10971 pub ignition_voltage: f32,
10972 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10973 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10974 pub fuel_pressure: f32,
10975}
10976impl EFI_STATUS_DATA {
10977 pub const ENCODED_LEN: usize = 73usize;
10978 pub const DEFAULT: Self = Self {
10979 ecu_index: 0.0_f32,
10980 rpm: 0.0_f32,
10981 fuel_consumed: 0.0_f32,
10982 fuel_flow: 0.0_f32,
10983 engine_load: 0.0_f32,
10984 throttle_position: 0.0_f32,
10985 spark_dwell_time: 0.0_f32,
10986 barometric_pressure: 0.0_f32,
10987 intake_manifold_pressure: 0.0_f32,
10988 intake_manifold_temperature: 0.0_f32,
10989 cylinder_head_temperature: 0.0_f32,
10990 ignition_timing: 0.0_f32,
10991 injection_time: 0.0_f32,
10992 exhaust_gas_temperature: 0.0_f32,
10993 throttle_out: 0.0_f32,
10994 pt_compensation: 0.0_f32,
10995 health: 0_u8,
10996 ignition_voltage: 0.0_f32,
10997 fuel_pressure: 0.0_f32,
10998 };
10999 #[cfg(feature = "arbitrary")]
11000 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11001 use arbitrary::{Arbitrary, Unstructured};
11002 let mut buf = [0u8; 1024];
11003 rng.fill_bytes(&mut buf);
11004 let mut unstructured = Unstructured::new(&buf);
11005 Self::arbitrary(&mut unstructured).unwrap_or_default()
11006 }
11007}
11008impl Default for EFI_STATUS_DATA {
11009 fn default() -> Self {
11010 Self::DEFAULT.clone()
11011 }
11012}
11013impl MessageData for EFI_STATUS_DATA {
11014 type Message = MavMessage;
11015 const ID: u32 = 225u32;
11016 const NAME: &'static str = "EFI_STATUS";
11017 const EXTRA_CRC: u8 = 208u8;
11018 const ENCODED_LEN: usize = 73usize;
11019 fn deser(
11020 _version: MavlinkVersion,
11021 __input: &[u8],
11022 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11023 let avail_len = __input.len();
11024 let mut payload_buf = [0; Self::ENCODED_LEN];
11025 let mut buf = if avail_len < Self::ENCODED_LEN {
11026 payload_buf[0..avail_len].copy_from_slice(__input);
11027 Bytes::new(&payload_buf)
11028 } else {
11029 Bytes::new(__input)
11030 };
11031 let mut __struct = Self::default();
11032 __struct.ecu_index = buf.get_f32_le();
11033 __struct.rpm = buf.get_f32_le();
11034 __struct.fuel_consumed = buf.get_f32_le();
11035 __struct.fuel_flow = buf.get_f32_le();
11036 __struct.engine_load = buf.get_f32_le();
11037 __struct.throttle_position = buf.get_f32_le();
11038 __struct.spark_dwell_time = buf.get_f32_le();
11039 __struct.barometric_pressure = buf.get_f32_le();
11040 __struct.intake_manifold_pressure = buf.get_f32_le();
11041 __struct.intake_manifold_temperature = buf.get_f32_le();
11042 __struct.cylinder_head_temperature = buf.get_f32_le();
11043 __struct.ignition_timing = buf.get_f32_le();
11044 __struct.injection_time = buf.get_f32_le();
11045 __struct.exhaust_gas_temperature = buf.get_f32_le();
11046 __struct.throttle_out = buf.get_f32_le();
11047 __struct.pt_compensation = buf.get_f32_le();
11048 __struct.health = buf.get_u8();
11049 __struct.ignition_voltage = buf.get_f32_le();
11050 __struct.fuel_pressure = buf.get_f32_le();
11051 Ok(__struct)
11052 }
11053 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11054 let mut __tmp = BytesMut::new(bytes);
11055 #[allow(clippy::absurd_extreme_comparisons)]
11056 #[allow(unused_comparisons)]
11057 if __tmp.remaining() < Self::ENCODED_LEN {
11058 panic!(
11059 "buffer is too small (need {} bytes, but got {})",
11060 Self::ENCODED_LEN,
11061 __tmp.remaining(),
11062 )
11063 }
11064 __tmp.put_f32_le(self.ecu_index);
11065 __tmp.put_f32_le(self.rpm);
11066 __tmp.put_f32_le(self.fuel_consumed);
11067 __tmp.put_f32_le(self.fuel_flow);
11068 __tmp.put_f32_le(self.engine_load);
11069 __tmp.put_f32_le(self.throttle_position);
11070 __tmp.put_f32_le(self.spark_dwell_time);
11071 __tmp.put_f32_le(self.barometric_pressure);
11072 __tmp.put_f32_le(self.intake_manifold_pressure);
11073 __tmp.put_f32_le(self.intake_manifold_temperature);
11074 __tmp.put_f32_le(self.cylinder_head_temperature);
11075 __tmp.put_f32_le(self.ignition_timing);
11076 __tmp.put_f32_le(self.injection_time);
11077 __tmp.put_f32_le(self.exhaust_gas_temperature);
11078 __tmp.put_f32_le(self.throttle_out);
11079 __tmp.put_f32_le(self.pt_compensation);
11080 __tmp.put_u8(self.health);
11081 if matches!(version, MavlinkVersion::V2) {
11082 __tmp.put_f32_le(self.ignition_voltage);
11083 __tmp.put_f32_le(self.fuel_pressure);
11084 let len = __tmp.len();
11085 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11086 } else {
11087 __tmp.len()
11088 }
11089 }
11090}
11091#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11092#[doc = ""]
11093#[doc = "ID: 131"]
11094#[derive(Debug, Clone, PartialEq)]
11095#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11096#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11097#[cfg_attr(feature = "ts", derive(TS))]
11098#[cfg_attr(feature = "ts", ts(export))]
11099pub struct ENCAPSULATED_DATA_DATA {
11100 #[doc = "sequence number (starting with 0 on every transmission)"]
11101 pub seqnr: u16,
11102 #[doc = "image data bytes"]
11103 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11104 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11105 pub data: [u8; 253],
11106}
11107impl ENCAPSULATED_DATA_DATA {
11108 pub const ENCODED_LEN: usize = 255usize;
11109 pub const DEFAULT: Self = Self {
11110 seqnr: 0_u16,
11111 data: [0_u8; 253usize],
11112 };
11113 #[cfg(feature = "arbitrary")]
11114 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11115 use arbitrary::{Arbitrary, Unstructured};
11116 let mut buf = [0u8; 1024];
11117 rng.fill_bytes(&mut buf);
11118 let mut unstructured = Unstructured::new(&buf);
11119 Self::arbitrary(&mut unstructured).unwrap_or_default()
11120 }
11121}
11122impl Default for ENCAPSULATED_DATA_DATA {
11123 fn default() -> Self {
11124 Self::DEFAULT.clone()
11125 }
11126}
11127impl MessageData for ENCAPSULATED_DATA_DATA {
11128 type Message = MavMessage;
11129 const ID: u32 = 131u32;
11130 const NAME: &'static str = "ENCAPSULATED_DATA";
11131 const EXTRA_CRC: u8 = 223u8;
11132 const ENCODED_LEN: usize = 255usize;
11133 fn deser(
11134 _version: MavlinkVersion,
11135 __input: &[u8],
11136 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11137 let avail_len = __input.len();
11138 let mut payload_buf = [0; Self::ENCODED_LEN];
11139 let mut buf = if avail_len < Self::ENCODED_LEN {
11140 payload_buf[0..avail_len].copy_from_slice(__input);
11141 Bytes::new(&payload_buf)
11142 } else {
11143 Bytes::new(__input)
11144 };
11145 let mut __struct = Self::default();
11146 __struct.seqnr = buf.get_u16_le();
11147 for v in &mut __struct.data {
11148 let val = buf.get_u8();
11149 *v = val;
11150 }
11151 Ok(__struct)
11152 }
11153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11154 let mut __tmp = BytesMut::new(bytes);
11155 #[allow(clippy::absurd_extreme_comparisons)]
11156 #[allow(unused_comparisons)]
11157 if __tmp.remaining() < Self::ENCODED_LEN {
11158 panic!(
11159 "buffer is too small (need {} bytes, but got {})",
11160 Self::ENCODED_LEN,
11161 __tmp.remaining(),
11162 )
11163 }
11164 __tmp.put_u16_le(self.seqnr);
11165 for val in &self.data {
11166 __tmp.put_u8(*val);
11167 }
11168 if matches!(version, MavlinkVersion::V2) {
11169 let len = __tmp.len();
11170 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11171 } else {
11172 __tmp.len()
11173 }
11174 }
11175}
11176#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11177#[doc = ""]
11178#[doc = "ID: 290"]
11179#[derive(Debug, Clone, PartialEq)]
11180#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11182#[cfg_attr(feature = "ts", derive(TS))]
11183#[cfg_attr(feature = "ts", ts(export))]
11184pub struct ESC_INFO_DATA {
11185 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11186 pub time_usec: u64,
11187 #[doc = "Number of reported errors by each ESC since boot."]
11188 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11189 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11190 pub error_count: [u32; 4],
11191 #[doc = "Counter of data packets received."]
11192 pub counter: u16,
11193 #[doc = "Bitmap of ESC failure flags."]
11194 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11195 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11196 pub failure_flags: [u16; 4],
11197 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11198 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11199 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11200 pub temperature: [i16; 4],
11201 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11202 pub index: u8,
11203 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11204 pub count: u8,
11205 #[doc = "Connection type protocol for all ESC."]
11206 pub connection_type: EscConnectionType,
11207 #[doc = "Information regarding online/offline status of each ESC."]
11208 pub info: u8,
11209}
11210impl ESC_INFO_DATA {
11211 pub const ENCODED_LEN: usize = 46usize;
11212 pub const DEFAULT: Self = Self {
11213 time_usec: 0_u64,
11214 error_count: [0_u32; 4usize],
11215 counter: 0_u16,
11216 failure_flags: [0_u16; 4usize],
11217 temperature: [0_i16; 4usize],
11218 index: 0_u8,
11219 count: 0_u8,
11220 connection_type: EscConnectionType::DEFAULT,
11221 info: 0_u8,
11222 };
11223 #[cfg(feature = "arbitrary")]
11224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11225 use arbitrary::{Arbitrary, Unstructured};
11226 let mut buf = [0u8; 1024];
11227 rng.fill_bytes(&mut buf);
11228 let mut unstructured = Unstructured::new(&buf);
11229 Self::arbitrary(&mut unstructured).unwrap_or_default()
11230 }
11231}
11232impl Default for ESC_INFO_DATA {
11233 fn default() -> Self {
11234 Self::DEFAULT.clone()
11235 }
11236}
11237impl MessageData for ESC_INFO_DATA {
11238 type Message = MavMessage;
11239 const ID: u32 = 290u32;
11240 const NAME: &'static str = "ESC_INFO";
11241 const EXTRA_CRC: u8 = 251u8;
11242 const ENCODED_LEN: usize = 46usize;
11243 fn deser(
11244 _version: MavlinkVersion,
11245 __input: &[u8],
11246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11247 let avail_len = __input.len();
11248 let mut payload_buf = [0; Self::ENCODED_LEN];
11249 let mut buf = if avail_len < Self::ENCODED_LEN {
11250 payload_buf[0..avail_len].copy_from_slice(__input);
11251 Bytes::new(&payload_buf)
11252 } else {
11253 Bytes::new(__input)
11254 };
11255 let mut __struct = Self::default();
11256 __struct.time_usec = buf.get_u64_le();
11257 for v in &mut __struct.error_count {
11258 let val = buf.get_u32_le();
11259 *v = val;
11260 }
11261 __struct.counter = buf.get_u16_le();
11262 for v in &mut __struct.failure_flags {
11263 let val = buf.get_u16_le();
11264 *v = val;
11265 }
11266 for v in &mut __struct.temperature {
11267 let val = buf.get_i16_le();
11268 *v = val;
11269 }
11270 __struct.index = buf.get_u8();
11271 __struct.count = buf.get_u8();
11272 let tmp = buf.get_u8();
11273 __struct.connection_type =
11274 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11275 enum_type: "EscConnectionType",
11276 value: tmp as u32,
11277 })?;
11278 __struct.info = buf.get_u8();
11279 Ok(__struct)
11280 }
11281 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11282 let mut __tmp = BytesMut::new(bytes);
11283 #[allow(clippy::absurd_extreme_comparisons)]
11284 #[allow(unused_comparisons)]
11285 if __tmp.remaining() < Self::ENCODED_LEN {
11286 panic!(
11287 "buffer is too small (need {} bytes, but got {})",
11288 Self::ENCODED_LEN,
11289 __tmp.remaining(),
11290 )
11291 }
11292 __tmp.put_u64_le(self.time_usec);
11293 for val in &self.error_count {
11294 __tmp.put_u32_le(*val);
11295 }
11296 __tmp.put_u16_le(self.counter);
11297 for val in &self.failure_flags {
11298 __tmp.put_u16_le(*val);
11299 }
11300 for val in &self.temperature {
11301 __tmp.put_i16_le(*val);
11302 }
11303 __tmp.put_u8(self.index);
11304 __tmp.put_u8(self.count);
11305 __tmp.put_u8(self.connection_type as u8);
11306 __tmp.put_u8(self.info);
11307 if matches!(version, MavlinkVersion::V2) {
11308 let len = __tmp.len();
11309 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11310 } else {
11311 __tmp.len()
11312 }
11313 }
11314}
11315#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11316#[doc = ""]
11317#[doc = "ID: 291"]
11318#[derive(Debug, Clone, PartialEq)]
11319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11320#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11321#[cfg_attr(feature = "ts", derive(TS))]
11322#[cfg_attr(feature = "ts", ts(export))]
11323pub struct ESC_STATUS_DATA {
11324 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11325 pub time_usec: u64,
11326 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11327 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11328 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11329 pub rpm: [i32; 4],
11330 #[doc = "Voltage measured from each ESC."]
11331 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11332 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11333 pub voltage: [f32; 4],
11334 #[doc = "Current measured from each ESC."]
11335 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11336 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11337 pub current: [f32; 4],
11338 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11339 pub index: u8,
11340}
11341impl ESC_STATUS_DATA {
11342 pub const ENCODED_LEN: usize = 57usize;
11343 pub const DEFAULT: Self = Self {
11344 time_usec: 0_u64,
11345 rpm: [0_i32; 4usize],
11346 voltage: [0.0_f32; 4usize],
11347 current: [0.0_f32; 4usize],
11348 index: 0_u8,
11349 };
11350 #[cfg(feature = "arbitrary")]
11351 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11352 use arbitrary::{Arbitrary, Unstructured};
11353 let mut buf = [0u8; 1024];
11354 rng.fill_bytes(&mut buf);
11355 let mut unstructured = Unstructured::new(&buf);
11356 Self::arbitrary(&mut unstructured).unwrap_or_default()
11357 }
11358}
11359impl Default for ESC_STATUS_DATA {
11360 fn default() -> Self {
11361 Self::DEFAULT.clone()
11362 }
11363}
11364impl MessageData for ESC_STATUS_DATA {
11365 type Message = MavMessage;
11366 const ID: u32 = 291u32;
11367 const NAME: &'static str = "ESC_STATUS";
11368 const EXTRA_CRC: u8 = 10u8;
11369 const ENCODED_LEN: usize = 57usize;
11370 fn deser(
11371 _version: MavlinkVersion,
11372 __input: &[u8],
11373 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11374 let avail_len = __input.len();
11375 let mut payload_buf = [0; Self::ENCODED_LEN];
11376 let mut buf = if avail_len < Self::ENCODED_LEN {
11377 payload_buf[0..avail_len].copy_from_slice(__input);
11378 Bytes::new(&payload_buf)
11379 } else {
11380 Bytes::new(__input)
11381 };
11382 let mut __struct = Self::default();
11383 __struct.time_usec = buf.get_u64_le();
11384 for v in &mut __struct.rpm {
11385 let val = buf.get_i32_le();
11386 *v = val;
11387 }
11388 for v in &mut __struct.voltage {
11389 let val = buf.get_f32_le();
11390 *v = val;
11391 }
11392 for v in &mut __struct.current {
11393 let val = buf.get_f32_le();
11394 *v = val;
11395 }
11396 __struct.index = buf.get_u8();
11397 Ok(__struct)
11398 }
11399 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11400 let mut __tmp = BytesMut::new(bytes);
11401 #[allow(clippy::absurd_extreme_comparisons)]
11402 #[allow(unused_comparisons)]
11403 if __tmp.remaining() < Self::ENCODED_LEN {
11404 panic!(
11405 "buffer is too small (need {} bytes, but got {})",
11406 Self::ENCODED_LEN,
11407 __tmp.remaining(),
11408 )
11409 }
11410 __tmp.put_u64_le(self.time_usec);
11411 for val in &self.rpm {
11412 __tmp.put_i32_le(*val);
11413 }
11414 for val in &self.voltage {
11415 __tmp.put_f32_le(*val);
11416 }
11417 for val in &self.current {
11418 __tmp.put_f32_le(*val);
11419 }
11420 __tmp.put_u8(self.index);
11421 if matches!(version, MavlinkVersion::V2) {
11422 let len = __tmp.len();
11423 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11424 } else {
11425 __tmp.len()
11426 }
11427 }
11428}
11429#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11430#[doc = ""]
11431#[doc = "ID: 230"]
11432#[derive(Debug, Clone, PartialEq)]
11433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11435#[cfg_attr(feature = "ts", derive(TS))]
11436#[cfg_attr(feature = "ts", ts(export))]
11437pub struct ESTIMATOR_STATUS_DATA {
11438 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11439 pub time_usec: u64,
11440 #[doc = "Velocity innovation test ratio"]
11441 pub vel_ratio: f32,
11442 #[doc = "Horizontal position innovation test ratio"]
11443 pub pos_horiz_ratio: f32,
11444 #[doc = "Vertical position innovation test ratio"]
11445 pub pos_vert_ratio: f32,
11446 #[doc = "Magnetometer innovation test ratio"]
11447 pub mag_ratio: f32,
11448 #[doc = "Height above terrain innovation test ratio"]
11449 pub hagl_ratio: f32,
11450 #[doc = "True airspeed innovation test ratio"]
11451 pub tas_ratio: f32,
11452 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11453 pub pos_horiz_accuracy: f32,
11454 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11455 pub pos_vert_accuracy: f32,
11456 #[doc = "Bitmap indicating which EKF outputs are valid."]
11457 pub flags: EstimatorStatusFlags,
11458}
11459impl ESTIMATOR_STATUS_DATA {
11460 pub const ENCODED_LEN: usize = 42usize;
11461 pub const DEFAULT: Self = Self {
11462 time_usec: 0_u64,
11463 vel_ratio: 0.0_f32,
11464 pos_horiz_ratio: 0.0_f32,
11465 pos_vert_ratio: 0.0_f32,
11466 mag_ratio: 0.0_f32,
11467 hagl_ratio: 0.0_f32,
11468 tas_ratio: 0.0_f32,
11469 pos_horiz_accuracy: 0.0_f32,
11470 pos_vert_accuracy: 0.0_f32,
11471 flags: EstimatorStatusFlags::DEFAULT,
11472 };
11473 #[cfg(feature = "arbitrary")]
11474 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11475 use arbitrary::{Arbitrary, Unstructured};
11476 let mut buf = [0u8; 1024];
11477 rng.fill_bytes(&mut buf);
11478 let mut unstructured = Unstructured::new(&buf);
11479 Self::arbitrary(&mut unstructured).unwrap_or_default()
11480 }
11481}
11482impl Default for ESTIMATOR_STATUS_DATA {
11483 fn default() -> Self {
11484 Self::DEFAULT.clone()
11485 }
11486}
11487impl MessageData for ESTIMATOR_STATUS_DATA {
11488 type Message = MavMessage;
11489 const ID: u32 = 230u32;
11490 const NAME: &'static str = "ESTIMATOR_STATUS";
11491 const EXTRA_CRC: u8 = 163u8;
11492 const ENCODED_LEN: usize = 42usize;
11493 fn deser(
11494 _version: MavlinkVersion,
11495 __input: &[u8],
11496 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11497 let avail_len = __input.len();
11498 let mut payload_buf = [0; Self::ENCODED_LEN];
11499 let mut buf = if avail_len < Self::ENCODED_LEN {
11500 payload_buf[0..avail_len].copy_from_slice(__input);
11501 Bytes::new(&payload_buf)
11502 } else {
11503 Bytes::new(__input)
11504 };
11505 let mut __struct = Self::default();
11506 __struct.time_usec = buf.get_u64_le();
11507 __struct.vel_ratio = buf.get_f32_le();
11508 __struct.pos_horiz_ratio = buf.get_f32_le();
11509 __struct.pos_vert_ratio = buf.get_f32_le();
11510 __struct.mag_ratio = buf.get_f32_le();
11511 __struct.hagl_ratio = buf.get_f32_le();
11512 __struct.tas_ratio = buf.get_f32_le();
11513 __struct.pos_horiz_accuracy = buf.get_f32_le();
11514 __struct.pos_vert_accuracy = buf.get_f32_le();
11515 let tmp = buf.get_u16_le();
11516 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11517 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11518 flag_type: "EstimatorStatusFlags",
11519 value: tmp as u32,
11520 })?;
11521 Ok(__struct)
11522 }
11523 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11524 let mut __tmp = BytesMut::new(bytes);
11525 #[allow(clippy::absurd_extreme_comparisons)]
11526 #[allow(unused_comparisons)]
11527 if __tmp.remaining() < Self::ENCODED_LEN {
11528 panic!(
11529 "buffer is too small (need {} bytes, but got {})",
11530 Self::ENCODED_LEN,
11531 __tmp.remaining(),
11532 )
11533 }
11534 __tmp.put_u64_le(self.time_usec);
11535 __tmp.put_f32_le(self.vel_ratio);
11536 __tmp.put_f32_le(self.pos_horiz_ratio);
11537 __tmp.put_f32_le(self.pos_vert_ratio);
11538 __tmp.put_f32_le(self.mag_ratio);
11539 __tmp.put_f32_le(self.hagl_ratio);
11540 __tmp.put_f32_le(self.tas_ratio);
11541 __tmp.put_f32_le(self.pos_horiz_accuracy);
11542 __tmp.put_f32_le(self.pos_vert_accuracy);
11543 __tmp.put_u16_le(self.flags.bits());
11544 if matches!(version, MavlinkVersion::V2) {
11545 let len = __tmp.len();
11546 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11547 } else {
11548 __tmp.len()
11549 }
11550 }
11551}
11552#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11553#[doc = ""]
11554#[doc = "ID: 410"]
11555#[derive(Debug, Clone, PartialEq)]
11556#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11557#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11558#[cfg_attr(feature = "ts", derive(TS))]
11559#[cfg_attr(feature = "ts", ts(export))]
11560pub struct EVENT_DATA {
11561 #[doc = "Event ID (as defined in the component metadata)"]
11562 pub id: u32,
11563 #[doc = "Timestamp (time since system boot when the event happened)."]
11564 pub event_time_boot_ms: u32,
11565 #[doc = "Sequence number."]
11566 pub sequence: u16,
11567 #[doc = "Component ID"]
11568 pub destination_component: u8,
11569 #[doc = "System ID"]
11570 pub destination_system: u8,
11571 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11572 pub log_levels: u8,
11573 #[doc = "Arguments (depend on event ID)."]
11574 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11575 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11576 pub arguments: [u8; 40],
11577}
11578impl EVENT_DATA {
11579 pub const ENCODED_LEN: usize = 53usize;
11580 pub const DEFAULT: Self = Self {
11581 id: 0_u32,
11582 event_time_boot_ms: 0_u32,
11583 sequence: 0_u16,
11584 destination_component: 0_u8,
11585 destination_system: 0_u8,
11586 log_levels: 0_u8,
11587 arguments: [0_u8; 40usize],
11588 };
11589 #[cfg(feature = "arbitrary")]
11590 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11591 use arbitrary::{Arbitrary, Unstructured};
11592 let mut buf = [0u8; 1024];
11593 rng.fill_bytes(&mut buf);
11594 let mut unstructured = Unstructured::new(&buf);
11595 Self::arbitrary(&mut unstructured).unwrap_or_default()
11596 }
11597}
11598impl Default for EVENT_DATA {
11599 fn default() -> Self {
11600 Self::DEFAULT.clone()
11601 }
11602}
11603impl MessageData for EVENT_DATA {
11604 type Message = MavMessage;
11605 const ID: u32 = 410u32;
11606 const NAME: &'static str = "EVENT";
11607 const EXTRA_CRC: u8 = 160u8;
11608 const ENCODED_LEN: usize = 53usize;
11609 fn deser(
11610 _version: MavlinkVersion,
11611 __input: &[u8],
11612 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11613 let avail_len = __input.len();
11614 let mut payload_buf = [0; Self::ENCODED_LEN];
11615 let mut buf = if avail_len < Self::ENCODED_LEN {
11616 payload_buf[0..avail_len].copy_from_slice(__input);
11617 Bytes::new(&payload_buf)
11618 } else {
11619 Bytes::new(__input)
11620 };
11621 let mut __struct = Self::default();
11622 __struct.id = buf.get_u32_le();
11623 __struct.event_time_boot_ms = buf.get_u32_le();
11624 __struct.sequence = buf.get_u16_le();
11625 __struct.destination_component = buf.get_u8();
11626 __struct.destination_system = buf.get_u8();
11627 __struct.log_levels = buf.get_u8();
11628 for v in &mut __struct.arguments {
11629 let val = buf.get_u8();
11630 *v = val;
11631 }
11632 Ok(__struct)
11633 }
11634 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11635 let mut __tmp = BytesMut::new(bytes);
11636 #[allow(clippy::absurd_extreme_comparisons)]
11637 #[allow(unused_comparisons)]
11638 if __tmp.remaining() < Self::ENCODED_LEN {
11639 panic!(
11640 "buffer is too small (need {} bytes, but got {})",
11641 Self::ENCODED_LEN,
11642 __tmp.remaining(),
11643 )
11644 }
11645 __tmp.put_u32_le(self.id);
11646 __tmp.put_u32_le(self.event_time_boot_ms);
11647 __tmp.put_u16_le(self.sequence);
11648 __tmp.put_u8(self.destination_component);
11649 __tmp.put_u8(self.destination_system);
11650 __tmp.put_u8(self.log_levels);
11651 for val in &self.arguments {
11652 __tmp.put_u8(*val);
11653 }
11654 if matches!(version, MavlinkVersion::V2) {
11655 let len = __tmp.len();
11656 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11657 } else {
11658 __tmp.len()
11659 }
11660 }
11661}
11662#[doc = "Provides state for additional features."]
11663#[doc = ""]
11664#[doc = "ID: 245"]
11665#[derive(Debug, Clone, PartialEq)]
11666#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11667#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11668#[cfg_attr(feature = "ts", derive(TS))]
11669#[cfg_attr(feature = "ts", ts(export))]
11670pub struct EXTENDED_SYS_STATE_DATA {
11671 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11672 pub vtol_state: MavVtolState,
11673 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11674 pub landed_state: MavLandedState,
11675}
11676impl EXTENDED_SYS_STATE_DATA {
11677 pub const ENCODED_LEN: usize = 2usize;
11678 pub const DEFAULT: Self = Self {
11679 vtol_state: MavVtolState::DEFAULT,
11680 landed_state: MavLandedState::DEFAULT,
11681 };
11682 #[cfg(feature = "arbitrary")]
11683 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11684 use arbitrary::{Arbitrary, Unstructured};
11685 let mut buf = [0u8; 1024];
11686 rng.fill_bytes(&mut buf);
11687 let mut unstructured = Unstructured::new(&buf);
11688 Self::arbitrary(&mut unstructured).unwrap_or_default()
11689 }
11690}
11691impl Default for EXTENDED_SYS_STATE_DATA {
11692 fn default() -> Self {
11693 Self::DEFAULT.clone()
11694 }
11695}
11696impl MessageData for EXTENDED_SYS_STATE_DATA {
11697 type Message = MavMessage;
11698 const ID: u32 = 245u32;
11699 const NAME: &'static str = "EXTENDED_SYS_STATE";
11700 const EXTRA_CRC: u8 = 130u8;
11701 const ENCODED_LEN: usize = 2usize;
11702 fn deser(
11703 _version: MavlinkVersion,
11704 __input: &[u8],
11705 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11706 let avail_len = __input.len();
11707 let mut payload_buf = [0; Self::ENCODED_LEN];
11708 let mut buf = if avail_len < Self::ENCODED_LEN {
11709 payload_buf[0..avail_len].copy_from_slice(__input);
11710 Bytes::new(&payload_buf)
11711 } else {
11712 Bytes::new(__input)
11713 };
11714 let mut __struct = Self::default();
11715 let tmp = buf.get_u8();
11716 __struct.vtol_state =
11717 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11718 enum_type: "MavVtolState",
11719 value: tmp as u32,
11720 })?;
11721 let tmp = buf.get_u8();
11722 __struct.landed_state =
11723 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11724 enum_type: "MavLandedState",
11725 value: tmp as u32,
11726 })?;
11727 Ok(__struct)
11728 }
11729 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11730 let mut __tmp = BytesMut::new(bytes);
11731 #[allow(clippy::absurd_extreme_comparisons)]
11732 #[allow(unused_comparisons)]
11733 if __tmp.remaining() < Self::ENCODED_LEN {
11734 panic!(
11735 "buffer is too small (need {} bytes, but got {})",
11736 Self::ENCODED_LEN,
11737 __tmp.remaining(),
11738 )
11739 }
11740 __tmp.put_u8(self.vtol_state as u8);
11741 __tmp.put_u8(self.landed_state as u8);
11742 if matches!(version, MavlinkVersion::V2) {
11743 let len = __tmp.len();
11744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11745 } else {
11746 __tmp.len()
11747 }
11748 }
11749}
11750#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11751#[doc = ""]
11752#[doc = "ID: 162"]
11753#[derive(Debug, Clone, PartialEq)]
11754#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11756#[cfg_attr(feature = "ts", derive(TS))]
11757#[cfg_attr(feature = "ts", ts(export))]
11758pub struct FENCE_STATUS_DATA {
11759 #[doc = "Time (since boot) of last breach."]
11760 pub breach_time: u32,
11761 #[doc = "Number of fence breaches."]
11762 pub breach_count: u16,
11763 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11764 pub breach_status: u8,
11765 #[doc = "Last breach type."]
11766 pub breach_type: FenceBreach,
11767 #[doc = "Active action to prevent fence breach"]
11768 #[cfg_attr(feature = "serde", serde(default))]
11769 pub breach_mitigation: FenceMitigate,
11770}
11771impl FENCE_STATUS_DATA {
11772 pub const ENCODED_LEN: usize = 9usize;
11773 pub const DEFAULT: Self = Self {
11774 breach_time: 0_u32,
11775 breach_count: 0_u16,
11776 breach_status: 0_u8,
11777 breach_type: FenceBreach::DEFAULT,
11778 breach_mitigation: FenceMitigate::DEFAULT,
11779 };
11780 #[cfg(feature = "arbitrary")]
11781 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11782 use arbitrary::{Arbitrary, Unstructured};
11783 let mut buf = [0u8; 1024];
11784 rng.fill_bytes(&mut buf);
11785 let mut unstructured = Unstructured::new(&buf);
11786 Self::arbitrary(&mut unstructured).unwrap_or_default()
11787 }
11788}
11789impl Default for FENCE_STATUS_DATA {
11790 fn default() -> Self {
11791 Self::DEFAULT.clone()
11792 }
11793}
11794impl MessageData for FENCE_STATUS_DATA {
11795 type Message = MavMessage;
11796 const ID: u32 = 162u32;
11797 const NAME: &'static str = "FENCE_STATUS";
11798 const EXTRA_CRC: u8 = 189u8;
11799 const ENCODED_LEN: usize = 9usize;
11800 fn deser(
11801 _version: MavlinkVersion,
11802 __input: &[u8],
11803 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11804 let avail_len = __input.len();
11805 let mut payload_buf = [0; Self::ENCODED_LEN];
11806 let mut buf = if avail_len < Self::ENCODED_LEN {
11807 payload_buf[0..avail_len].copy_from_slice(__input);
11808 Bytes::new(&payload_buf)
11809 } else {
11810 Bytes::new(__input)
11811 };
11812 let mut __struct = Self::default();
11813 __struct.breach_time = buf.get_u32_le();
11814 __struct.breach_count = buf.get_u16_le();
11815 __struct.breach_status = buf.get_u8();
11816 let tmp = buf.get_u8();
11817 __struct.breach_type =
11818 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11819 enum_type: "FenceBreach",
11820 value: tmp as u32,
11821 })?;
11822 let tmp = buf.get_u8();
11823 __struct.breach_mitigation =
11824 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11825 enum_type: "FenceMitigate",
11826 value: tmp as u32,
11827 })?;
11828 Ok(__struct)
11829 }
11830 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11831 let mut __tmp = BytesMut::new(bytes);
11832 #[allow(clippy::absurd_extreme_comparisons)]
11833 #[allow(unused_comparisons)]
11834 if __tmp.remaining() < Self::ENCODED_LEN {
11835 panic!(
11836 "buffer is too small (need {} bytes, but got {})",
11837 Self::ENCODED_LEN,
11838 __tmp.remaining(),
11839 )
11840 }
11841 __tmp.put_u32_le(self.breach_time);
11842 __tmp.put_u16_le(self.breach_count);
11843 __tmp.put_u8(self.breach_status);
11844 __tmp.put_u8(self.breach_type as u8);
11845 if matches!(version, MavlinkVersion::V2) {
11846 __tmp.put_u8(self.breach_mitigation as u8);
11847 let len = __tmp.len();
11848 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11849 } else {
11850 __tmp.len()
11851 }
11852 }
11853}
11854#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11855#[doc = ""]
11856#[doc = "ID: 110"]
11857#[derive(Debug, Clone, PartialEq)]
11858#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11859#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11860#[cfg_attr(feature = "ts", derive(TS))]
11861#[cfg_attr(feature = "ts", ts(export))]
11862pub struct FILE_TRANSFER_PROTOCOL_DATA {
11863 #[doc = "Network ID (0 for broadcast)"]
11864 pub target_network: u8,
11865 #[doc = "System ID (0 for broadcast)"]
11866 pub target_system: u8,
11867 #[doc = "Component ID (0 for broadcast)"]
11868 pub target_component: u8,
11869 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11870 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11871 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11872 pub payload: [u8; 251],
11873}
11874impl FILE_TRANSFER_PROTOCOL_DATA {
11875 pub const ENCODED_LEN: usize = 254usize;
11876 pub const DEFAULT: Self = Self {
11877 target_network: 0_u8,
11878 target_system: 0_u8,
11879 target_component: 0_u8,
11880 payload: [0_u8; 251usize],
11881 };
11882 #[cfg(feature = "arbitrary")]
11883 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11884 use arbitrary::{Arbitrary, Unstructured};
11885 let mut buf = [0u8; 1024];
11886 rng.fill_bytes(&mut buf);
11887 let mut unstructured = Unstructured::new(&buf);
11888 Self::arbitrary(&mut unstructured).unwrap_or_default()
11889 }
11890}
11891impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11892 fn default() -> Self {
11893 Self::DEFAULT.clone()
11894 }
11895}
11896impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11897 type Message = MavMessage;
11898 const ID: u32 = 110u32;
11899 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11900 const EXTRA_CRC: u8 = 84u8;
11901 const ENCODED_LEN: usize = 254usize;
11902 fn deser(
11903 _version: MavlinkVersion,
11904 __input: &[u8],
11905 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11906 let avail_len = __input.len();
11907 let mut payload_buf = [0; Self::ENCODED_LEN];
11908 let mut buf = if avail_len < Self::ENCODED_LEN {
11909 payload_buf[0..avail_len].copy_from_slice(__input);
11910 Bytes::new(&payload_buf)
11911 } else {
11912 Bytes::new(__input)
11913 };
11914 let mut __struct = Self::default();
11915 __struct.target_network = buf.get_u8();
11916 __struct.target_system = buf.get_u8();
11917 __struct.target_component = buf.get_u8();
11918 for v in &mut __struct.payload {
11919 let val = buf.get_u8();
11920 *v = val;
11921 }
11922 Ok(__struct)
11923 }
11924 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11925 let mut __tmp = BytesMut::new(bytes);
11926 #[allow(clippy::absurd_extreme_comparisons)]
11927 #[allow(unused_comparisons)]
11928 if __tmp.remaining() < Self::ENCODED_LEN {
11929 panic!(
11930 "buffer is too small (need {} bytes, but got {})",
11931 Self::ENCODED_LEN,
11932 __tmp.remaining(),
11933 )
11934 }
11935 __tmp.put_u8(self.target_network);
11936 __tmp.put_u8(self.target_system);
11937 __tmp.put_u8(self.target_component);
11938 for val in &self.payload {
11939 __tmp.put_u8(*val);
11940 }
11941 if matches!(version, MavlinkVersion::V2) {
11942 let len = __tmp.len();
11943 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11944 } else {
11945 __tmp.len()
11946 }
11947 }
11948}
11949#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11950#[doc = ""]
11951#[doc = "ID: 264"]
11952#[derive(Debug, Clone, PartialEq)]
11953#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11954#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11955#[cfg_attr(feature = "ts", derive(TS))]
11956#[cfg_attr(feature = "ts", ts(export))]
11957pub struct FLIGHT_INFORMATION_DATA {
11958 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11959 pub arming_time_utc: u64,
11960 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11961 pub takeoff_time_utc: u64,
11962 #[doc = "Flight number. Note, field is misnamed UUID."]
11963 pub flight_uuid: u64,
11964 #[doc = "Timestamp (time since system boot)."]
11965 pub time_boot_ms: u32,
11966 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11967 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11968 pub landing_time: u32,
11969}
11970impl FLIGHT_INFORMATION_DATA {
11971 pub const ENCODED_LEN: usize = 32usize;
11972 pub const DEFAULT: Self = Self {
11973 arming_time_utc: 0_u64,
11974 takeoff_time_utc: 0_u64,
11975 flight_uuid: 0_u64,
11976 time_boot_ms: 0_u32,
11977 landing_time: 0_u32,
11978 };
11979 #[cfg(feature = "arbitrary")]
11980 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11981 use arbitrary::{Arbitrary, Unstructured};
11982 let mut buf = [0u8; 1024];
11983 rng.fill_bytes(&mut buf);
11984 let mut unstructured = Unstructured::new(&buf);
11985 Self::arbitrary(&mut unstructured).unwrap_or_default()
11986 }
11987}
11988impl Default for FLIGHT_INFORMATION_DATA {
11989 fn default() -> Self {
11990 Self::DEFAULT.clone()
11991 }
11992}
11993impl MessageData for FLIGHT_INFORMATION_DATA {
11994 type Message = MavMessage;
11995 const ID: u32 = 264u32;
11996 const NAME: &'static str = "FLIGHT_INFORMATION";
11997 const EXTRA_CRC: u8 = 49u8;
11998 const ENCODED_LEN: usize = 32usize;
11999 fn deser(
12000 _version: MavlinkVersion,
12001 __input: &[u8],
12002 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12003 let avail_len = __input.len();
12004 let mut payload_buf = [0; Self::ENCODED_LEN];
12005 let mut buf = if avail_len < Self::ENCODED_LEN {
12006 payload_buf[0..avail_len].copy_from_slice(__input);
12007 Bytes::new(&payload_buf)
12008 } else {
12009 Bytes::new(__input)
12010 };
12011 let mut __struct = Self::default();
12012 __struct.arming_time_utc = buf.get_u64_le();
12013 __struct.takeoff_time_utc = buf.get_u64_le();
12014 __struct.flight_uuid = buf.get_u64_le();
12015 __struct.time_boot_ms = buf.get_u32_le();
12016 __struct.landing_time = buf.get_u32_le();
12017 Ok(__struct)
12018 }
12019 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12020 let mut __tmp = BytesMut::new(bytes);
12021 #[allow(clippy::absurd_extreme_comparisons)]
12022 #[allow(unused_comparisons)]
12023 if __tmp.remaining() < Self::ENCODED_LEN {
12024 panic!(
12025 "buffer is too small (need {} bytes, but got {})",
12026 Self::ENCODED_LEN,
12027 __tmp.remaining(),
12028 )
12029 }
12030 __tmp.put_u64_le(self.arming_time_utc);
12031 __tmp.put_u64_le(self.takeoff_time_utc);
12032 __tmp.put_u64_le(self.flight_uuid);
12033 __tmp.put_u32_le(self.time_boot_ms);
12034 if matches!(version, MavlinkVersion::V2) {
12035 __tmp.put_u32_le(self.landing_time);
12036 let len = __tmp.len();
12037 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12038 } else {
12039 __tmp.len()
12040 }
12041 }
12042}
12043#[doc = "Current motion information from a designated system."]
12044#[doc = ""]
12045#[doc = "ID: 144"]
12046#[derive(Debug, Clone, PartialEq)]
12047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12049#[cfg_attr(feature = "ts", derive(TS))]
12050#[cfg_attr(feature = "ts", ts(export))]
12051pub struct FOLLOW_TARGET_DATA {
12052 #[doc = "Timestamp (time since system boot)."]
12053 pub timestamp: u64,
12054 #[doc = "button states or switches of a tracker device"]
12055 pub custom_state: u64,
12056 #[doc = "Latitude (WGS84)"]
12057 pub lat: i32,
12058 #[doc = "Longitude (WGS84)"]
12059 pub lon: i32,
12060 #[doc = "Altitude (MSL)"]
12061 pub alt: f32,
12062 #[doc = "target velocity (0,0,0) for unknown"]
12063 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12064 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12065 pub vel: [f32; 3],
12066 #[doc = "linear target acceleration (0,0,0) for unknown"]
12067 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12068 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12069 pub acc: [f32; 3],
12070 #[doc = "(0 0 0 0 for unknown)"]
12071 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12072 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12073 pub attitude_q: [f32; 4],
12074 #[doc = "(0 0 0 for unknown)"]
12075 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12076 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12077 pub rates: [f32; 3],
12078 #[doc = "eph epv"]
12079 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12080 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12081 pub position_cov: [f32; 3],
12082 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12083 pub est_capabilities: u8,
12084}
12085impl FOLLOW_TARGET_DATA {
12086 pub const ENCODED_LEN: usize = 93usize;
12087 pub const DEFAULT: Self = Self {
12088 timestamp: 0_u64,
12089 custom_state: 0_u64,
12090 lat: 0_i32,
12091 lon: 0_i32,
12092 alt: 0.0_f32,
12093 vel: [0.0_f32; 3usize],
12094 acc: [0.0_f32; 3usize],
12095 attitude_q: [0.0_f32; 4usize],
12096 rates: [0.0_f32; 3usize],
12097 position_cov: [0.0_f32; 3usize],
12098 est_capabilities: 0_u8,
12099 };
12100 #[cfg(feature = "arbitrary")]
12101 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12102 use arbitrary::{Arbitrary, Unstructured};
12103 let mut buf = [0u8; 1024];
12104 rng.fill_bytes(&mut buf);
12105 let mut unstructured = Unstructured::new(&buf);
12106 Self::arbitrary(&mut unstructured).unwrap_or_default()
12107 }
12108}
12109impl Default for FOLLOW_TARGET_DATA {
12110 fn default() -> Self {
12111 Self::DEFAULT.clone()
12112 }
12113}
12114impl MessageData for FOLLOW_TARGET_DATA {
12115 type Message = MavMessage;
12116 const ID: u32 = 144u32;
12117 const NAME: &'static str = "FOLLOW_TARGET";
12118 const EXTRA_CRC: u8 = 127u8;
12119 const ENCODED_LEN: usize = 93usize;
12120 fn deser(
12121 _version: MavlinkVersion,
12122 __input: &[u8],
12123 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12124 let avail_len = __input.len();
12125 let mut payload_buf = [0; Self::ENCODED_LEN];
12126 let mut buf = if avail_len < Self::ENCODED_LEN {
12127 payload_buf[0..avail_len].copy_from_slice(__input);
12128 Bytes::new(&payload_buf)
12129 } else {
12130 Bytes::new(__input)
12131 };
12132 let mut __struct = Self::default();
12133 __struct.timestamp = buf.get_u64_le();
12134 __struct.custom_state = buf.get_u64_le();
12135 __struct.lat = buf.get_i32_le();
12136 __struct.lon = buf.get_i32_le();
12137 __struct.alt = buf.get_f32_le();
12138 for v in &mut __struct.vel {
12139 let val = buf.get_f32_le();
12140 *v = val;
12141 }
12142 for v in &mut __struct.acc {
12143 let val = buf.get_f32_le();
12144 *v = val;
12145 }
12146 for v in &mut __struct.attitude_q {
12147 let val = buf.get_f32_le();
12148 *v = val;
12149 }
12150 for v in &mut __struct.rates {
12151 let val = buf.get_f32_le();
12152 *v = val;
12153 }
12154 for v in &mut __struct.position_cov {
12155 let val = buf.get_f32_le();
12156 *v = val;
12157 }
12158 __struct.est_capabilities = buf.get_u8();
12159 Ok(__struct)
12160 }
12161 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12162 let mut __tmp = BytesMut::new(bytes);
12163 #[allow(clippy::absurd_extreme_comparisons)]
12164 #[allow(unused_comparisons)]
12165 if __tmp.remaining() < Self::ENCODED_LEN {
12166 panic!(
12167 "buffer is too small (need {} bytes, but got {})",
12168 Self::ENCODED_LEN,
12169 __tmp.remaining(),
12170 )
12171 }
12172 __tmp.put_u64_le(self.timestamp);
12173 __tmp.put_u64_le(self.custom_state);
12174 __tmp.put_i32_le(self.lat);
12175 __tmp.put_i32_le(self.lon);
12176 __tmp.put_f32_le(self.alt);
12177 for val in &self.vel {
12178 __tmp.put_f32_le(*val);
12179 }
12180 for val in &self.acc {
12181 __tmp.put_f32_le(*val);
12182 }
12183 for val in &self.attitude_q {
12184 __tmp.put_f32_le(*val);
12185 }
12186 for val in &self.rates {
12187 __tmp.put_f32_le(*val);
12188 }
12189 for val in &self.position_cov {
12190 __tmp.put_f32_le(*val);
12191 }
12192 __tmp.put_u8(self.est_capabilities);
12193 if matches!(version, MavlinkVersion::V2) {
12194 let len = __tmp.len();
12195 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12196 } else {
12197 __tmp.len()
12198 }
12199 }
12200}
12201#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12202#[doc = ""]
12203#[doc = "ID: 371"]
12204#[derive(Debug, Clone, PartialEq)]
12205#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12206#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12207#[cfg_attr(feature = "ts", derive(TS))]
12208#[cfg_attr(feature = "ts", ts(export))]
12209pub struct FUEL_STATUS_DATA {
12210 #[doc = "Capacity when full. Must be provided."]
12211 pub maximum_fuel: f32,
12212 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12213 pub consumed_fuel: f32,
12214 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12215 pub remaining_fuel: f32,
12216 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12217 pub flow_rate: f32,
12218 #[doc = "Fuel temperature. NaN: field not provided."]
12219 pub temperature: f32,
12220 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12221 pub fuel_type: MavFuelType,
12222 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12223 pub id: u8,
12224 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12225 pub percent_remaining: u8,
12226}
12227impl FUEL_STATUS_DATA {
12228 pub const ENCODED_LEN: usize = 26usize;
12229 pub const DEFAULT: Self = Self {
12230 maximum_fuel: 0.0_f32,
12231 consumed_fuel: 0.0_f32,
12232 remaining_fuel: 0.0_f32,
12233 flow_rate: 0.0_f32,
12234 temperature: 0.0_f32,
12235 fuel_type: MavFuelType::DEFAULT,
12236 id: 0_u8,
12237 percent_remaining: 0_u8,
12238 };
12239 #[cfg(feature = "arbitrary")]
12240 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12241 use arbitrary::{Arbitrary, Unstructured};
12242 let mut buf = [0u8; 1024];
12243 rng.fill_bytes(&mut buf);
12244 let mut unstructured = Unstructured::new(&buf);
12245 Self::arbitrary(&mut unstructured).unwrap_or_default()
12246 }
12247}
12248impl Default for FUEL_STATUS_DATA {
12249 fn default() -> Self {
12250 Self::DEFAULT.clone()
12251 }
12252}
12253impl MessageData for FUEL_STATUS_DATA {
12254 type Message = MavMessage;
12255 const ID: u32 = 371u32;
12256 const NAME: &'static str = "FUEL_STATUS";
12257 const EXTRA_CRC: u8 = 10u8;
12258 const ENCODED_LEN: usize = 26usize;
12259 fn deser(
12260 _version: MavlinkVersion,
12261 __input: &[u8],
12262 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12263 let avail_len = __input.len();
12264 let mut payload_buf = [0; Self::ENCODED_LEN];
12265 let mut buf = if avail_len < Self::ENCODED_LEN {
12266 payload_buf[0..avail_len].copy_from_slice(__input);
12267 Bytes::new(&payload_buf)
12268 } else {
12269 Bytes::new(__input)
12270 };
12271 let mut __struct = Self::default();
12272 __struct.maximum_fuel = buf.get_f32_le();
12273 __struct.consumed_fuel = buf.get_f32_le();
12274 __struct.remaining_fuel = buf.get_f32_le();
12275 __struct.flow_rate = buf.get_f32_le();
12276 __struct.temperature = buf.get_f32_le();
12277 let tmp = buf.get_u32_le();
12278 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12279 ::mavlink_core::error::ParserError::InvalidEnum {
12280 enum_type: "MavFuelType",
12281 value: tmp as u32,
12282 },
12283 )?;
12284 __struct.id = buf.get_u8();
12285 __struct.percent_remaining = buf.get_u8();
12286 Ok(__struct)
12287 }
12288 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12289 let mut __tmp = BytesMut::new(bytes);
12290 #[allow(clippy::absurd_extreme_comparisons)]
12291 #[allow(unused_comparisons)]
12292 if __tmp.remaining() < Self::ENCODED_LEN {
12293 panic!(
12294 "buffer is too small (need {} bytes, but got {})",
12295 Self::ENCODED_LEN,
12296 __tmp.remaining(),
12297 )
12298 }
12299 __tmp.put_f32_le(self.maximum_fuel);
12300 __tmp.put_f32_le(self.consumed_fuel);
12301 __tmp.put_f32_le(self.remaining_fuel);
12302 __tmp.put_f32_le(self.flow_rate);
12303 __tmp.put_f32_le(self.temperature);
12304 __tmp.put_u32_le(self.fuel_type as u32);
12305 __tmp.put_u8(self.id);
12306 __tmp.put_u8(self.percent_remaining);
12307 if matches!(version, MavlinkVersion::V2) {
12308 let len = __tmp.len();
12309 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12310 } else {
12311 __tmp.len()
12312 }
12313 }
12314}
12315#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12316#[doc = ""]
12317#[doc = "ID: 373"]
12318#[derive(Debug, Clone, PartialEq)]
12319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12320#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12321#[cfg_attr(feature = "ts", derive(TS))]
12322#[cfg_attr(feature = "ts", ts(export))]
12323pub struct GENERATOR_STATUS_DATA {
12324 #[doc = "Status flags."]
12325 pub status: MavGeneratorStatusFlag,
12326 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12327 pub battery_current: f32,
12328 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12329 pub load_current: f32,
12330 #[doc = "The power being generated. NaN: field not provided"]
12331 pub power_generated: f32,
12332 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12333 pub bus_voltage: f32,
12334 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12335 pub bat_current_setpoint: f32,
12336 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12337 pub runtime: u32,
12338 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12339 pub time_until_maintenance: i32,
12340 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12341 pub generator_speed: u16,
12342 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12343 pub rectifier_temperature: i16,
12344 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12345 pub generator_temperature: i16,
12346}
12347impl GENERATOR_STATUS_DATA {
12348 pub const ENCODED_LEN: usize = 42usize;
12349 pub const DEFAULT: Self = Self {
12350 status: MavGeneratorStatusFlag::DEFAULT,
12351 battery_current: 0.0_f32,
12352 load_current: 0.0_f32,
12353 power_generated: 0.0_f32,
12354 bus_voltage: 0.0_f32,
12355 bat_current_setpoint: 0.0_f32,
12356 runtime: 0_u32,
12357 time_until_maintenance: 0_i32,
12358 generator_speed: 0_u16,
12359 rectifier_temperature: 0_i16,
12360 generator_temperature: 0_i16,
12361 };
12362 #[cfg(feature = "arbitrary")]
12363 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12364 use arbitrary::{Arbitrary, Unstructured};
12365 let mut buf = [0u8; 1024];
12366 rng.fill_bytes(&mut buf);
12367 let mut unstructured = Unstructured::new(&buf);
12368 Self::arbitrary(&mut unstructured).unwrap_or_default()
12369 }
12370}
12371impl Default for GENERATOR_STATUS_DATA {
12372 fn default() -> Self {
12373 Self::DEFAULT.clone()
12374 }
12375}
12376impl MessageData for GENERATOR_STATUS_DATA {
12377 type Message = MavMessage;
12378 const ID: u32 = 373u32;
12379 const NAME: &'static str = "GENERATOR_STATUS";
12380 const EXTRA_CRC: u8 = 117u8;
12381 const ENCODED_LEN: usize = 42usize;
12382 fn deser(
12383 _version: MavlinkVersion,
12384 __input: &[u8],
12385 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12386 let avail_len = __input.len();
12387 let mut payload_buf = [0; Self::ENCODED_LEN];
12388 let mut buf = if avail_len < Self::ENCODED_LEN {
12389 payload_buf[0..avail_len].copy_from_slice(__input);
12390 Bytes::new(&payload_buf)
12391 } else {
12392 Bytes::new(__input)
12393 };
12394 let mut __struct = Self::default();
12395 let tmp = buf.get_u64_le();
12396 __struct.status = MavGeneratorStatusFlag::from_bits(
12397 tmp & MavGeneratorStatusFlag::all().bits(),
12398 )
12399 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12400 flag_type: "MavGeneratorStatusFlag",
12401 value: tmp as u32,
12402 })?;
12403 __struct.battery_current = buf.get_f32_le();
12404 __struct.load_current = buf.get_f32_le();
12405 __struct.power_generated = buf.get_f32_le();
12406 __struct.bus_voltage = buf.get_f32_le();
12407 __struct.bat_current_setpoint = buf.get_f32_le();
12408 __struct.runtime = buf.get_u32_le();
12409 __struct.time_until_maintenance = buf.get_i32_le();
12410 __struct.generator_speed = buf.get_u16_le();
12411 __struct.rectifier_temperature = buf.get_i16_le();
12412 __struct.generator_temperature = buf.get_i16_le();
12413 Ok(__struct)
12414 }
12415 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12416 let mut __tmp = BytesMut::new(bytes);
12417 #[allow(clippy::absurd_extreme_comparisons)]
12418 #[allow(unused_comparisons)]
12419 if __tmp.remaining() < Self::ENCODED_LEN {
12420 panic!(
12421 "buffer is too small (need {} bytes, but got {})",
12422 Self::ENCODED_LEN,
12423 __tmp.remaining(),
12424 )
12425 }
12426 __tmp.put_u64_le(self.status.bits());
12427 __tmp.put_f32_le(self.battery_current);
12428 __tmp.put_f32_le(self.load_current);
12429 __tmp.put_f32_le(self.power_generated);
12430 __tmp.put_f32_le(self.bus_voltage);
12431 __tmp.put_f32_le(self.bat_current_setpoint);
12432 __tmp.put_u32_le(self.runtime);
12433 __tmp.put_i32_le(self.time_until_maintenance);
12434 __tmp.put_u16_le(self.generator_speed);
12435 __tmp.put_i16_le(self.rectifier_temperature);
12436 __tmp.put_i16_le(self.generator_temperature);
12437 if matches!(version, MavlinkVersion::V2) {
12438 let len = __tmp.len();
12439 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12440 } else {
12441 __tmp.len()
12442 }
12443 }
12444}
12445#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12446#[doc = ""]
12447#[doc = "ID: 285"]
12448#[derive(Debug, Clone, PartialEq)]
12449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12450#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12451#[cfg_attr(feature = "ts", derive(TS))]
12452#[cfg_attr(feature = "ts", ts(export))]
12453pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12454 #[doc = "Timestamp (time since system boot)."]
12455 pub time_boot_ms: u32,
12456 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12457 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12458 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12459 pub q: [f32; 4],
12460 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12461 pub angular_velocity_x: f32,
12462 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12463 pub angular_velocity_y: f32,
12464 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12465 pub angular_velocity_z: f32,
12466 #[doc = "Failure flags (0 for no failure)"]
12467 pub failure_flags: GimbalDeviceErrorFlags,
12468 #[doc = "Current gimbal flags set."]
12469 pub flags: GimbalDeviceFlags,
12470 #[doc = "System ID"]
12471 pub target_system: u8,
12472 #[doc = "Component ID"]
12473 pub target_component: u8,
12474 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12475 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12476 pub delta_yaw: f32,
12477 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12478 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12479 pub delta_yaw_velocity: f32,
12480 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12481 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12482 pub gimbal_device_id: u8,
12483}
12484impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12485 pub const ENCODED_LEN: usize = 49usize;
12486 pub const DEFAULT: Self = Self {
12487 time_boot_ms: 0_u32,
12488 q: [0.0_f32; 4usize],
12489 angular_velocity_x: 0.0_f32,
12490 angular_velocity_y: 0.0_f32,
12491 angular_velocity_z: 0.0_f32,
12492 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12493 flags: GimbalDeviceFlags::DEFAULT,
12494 target_system: 0_u8,
12495 target_component: 0_u8,
12496 delta_yaw: 0.0_f32,
12497 delta_yaw_velocity: 0.0_f32,
12498 gimbal_device_id: 0_u8,
12499 };
12500 #[cfg(feature = "arbitrary")]
12501 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12502 use arbitrary::{Arbitrary, Unstructured};
12503 let mut buf = [0u8; 1024];
12504 rng.fill_bytes(&mut buf);
12505 let mut unstructured = Unstructured::new(&buf);
12506 Self::arbitrary(&mut unstructured).unwrap_or_default()
12507 }
12508}
12509impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12510 fn default() -> Self {
12511 Self::DEFAULT.clone()
12512 }
12513}
12514impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12515 type Message = MavMessage;
12516 const ID: u32 = 285u32;
12517 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12518 const EXTRA_CRC: u8 = 137u8;
12519 const ENCODED_LEN: usize = 49usize;
12520 fn deser(
12521 _version: MavlinkVersion,
12522 __input: &[u8],
12523 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12524 let avail_len = __input.len();
12525 let mut payload_buf = [0; Self::ENCODED_LEN];
12526 let mut buf = if avail_len < Self::ENCODED_LEN {
12527 payload_buf[0..avail_len].copy_from_slice(__input);
12528 Bytes::new(&payload_buf)
12529 } else {
12530 Bytes::new(__input)
12531 };
12532 let mut __struct = Self::default();
12533 __struct.time_boot_ms = buf.get_u32_le();
12534 for v in &mut __struct.q {
12535 let val = buf.get_f32_le();
12536 *v = val;
12537 }
12538 __struct.angular_velocity_x = buf.get_f32_le();
12539 __struct.angular_velocity_y = buf.get_f32_le();
12540 __struct.angular_velocity_z = buf.get_f32_le();
12541 let tmp = buf.get_u32_le();
12542 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12543 tmp & GimbalDeviceErrorFlags::all().bits(),
12544 )
12545 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12546 flag_type: "GimbalDeviceErrorFlags",
12547 value: tmp as u32,
12548 })?;
12549 let tmp = buf.get_u16_le();
12550 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12551 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12552 flag_type: "GimbalDeviceFlags",
12553 value: tmp as u32,
12554 })?;
12555 __struct.target_system = buf.get_u8();
12556 __struct.target_component = buf.get_u8();
12557 __struct.delta_yaw = buf.get_f32_le();
12558 __struct.delta_yaw_velocity = buf.get_f32_le();
12559 __struct.gimbal_device_id = buf.get_u8();
12560 Ok(__struct)
12561 }
12562 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12563 let mut __tmp = BytesMut::new(bytes);
12564 #[allow(clippy::absurd_extreme_comparisons)]
12565 #[allow(unused_comparisons)]
12566 if __tmp.remaining() < Self::ENCODED_LEN {
12567 panic!(
12568 "buffer is too small (need {} bytes, but got {})",
12569 Self::ENCODED_LEN,
12570 __tmp.remaining(),
12571 )
12572 }
12573 __tmp.put_u32_le(self.time_boot_ms);
12574 for val in &self.q {
12575 __tmp.put_f32_le(*val);
12576 }
12577 __tmp.put_f32_le(self.angular_velocity_x);
12578 __tmp.put_f32_le(self.angular_velocity_y);
12579 __tmp.put_f32_le(self.angular_velocity_z);
12580 __tmp.put_u32_le(self.failure_flags.bits());
12581 __tmp.put_u16_le(self.flags.bits());
12582 __tmp.put_u8(self.target_system);
12583 __tmp.put_u8(self.target_component);
12584 if matches!(version, MavlinkVersion::V2) {
12585 __tmp.put_f32_le(self.delta_yaw);
12586 __tmp.put_f32_le(self.delta_yaw_velocity);
12587 __tmp.put_u8(self.gimbal_device_id);
12588 let len = __tmp.len();
12589 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12590 } else {
12591 __tmp.len()
12592 }
12593 }
12594}
12595#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12596#[doc = ""]
12597#[doc = "ID: 283"]
12598#[derive(Debug, Clone, PartialEq)]
12599#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12601#[cfg_attr(feature = "ts", derive(TS))]
12602#[cfg_attr(feature = "ts", ts(export))]
12603pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12604 #[doc = "UID of gimbal hardware (0 if unknown)."]
12605 pub uid: u64,
12606 #[doc = "Timestamp (time since system boot)."]
12607 pub time_boot_ms: u32,
12608 #[doc = "0xff)."]
12609 pub firmware_version: u32,
12610 #[doc = "0xff)."]
12611 pub hardware_version: u32,
12612 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12613 pub roll_min: f32,
12614 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12615 pub roll_max: f32,
12616 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12617 pub pitch_min: f32,
12618 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12619 pub pitch_max: f32,
12620 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12621 pub yaw_min: f32,
12622 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12623 pub yaw_max: f32,
12624 #[doc = "Bitmap of gimbal capability flags."]
12625 pub cap_flags: GimbalDeviceCapFlags,
12626 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12627 pub custom_cap_flags: u16,
12628 #[doc = "Name of the gimbal vendor."]
12629 #[cfg_attr(
12630 feature = "serde",
12631 serde(
12632 serialize_with = "crate::nulstr::serialize::<_, 32>",
12633 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
12634 )
12635 )]
12636 #[cfg_attr(feature = "ts", ts(type = "string"))]
12637 pub vendor_name: [u8; 32],
12638 #[doc = "Name of the gimbal model."]
12639 #[cfg_attr(
12640 feature = "serde",
12641 serde(
12642 serialize_with = "crate::nulstr::serialize::<_, 32>",
12643 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
12644 )
12645 )]
12646 #[cfg_attr(feature = "ts", ts(type = "string"))]
12647 pub model_name: [u8; 32],
12648 #[doc = "Custom name of the gimbal given to it by the user."]
12649 #[cfg_attr(
12650 feature = "serde",
12651 serde(
12652 serialize_with = "crate::nulstr::serialize::<_, 32>",
12653 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
12654 )
12655 )]
12656 #[cfg_attr(feature = "ts", ts(type = "string"))]
12657 pub custom_name: [u8; 32],
12658 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12659 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12660 pub gimbal_device_id: u8,
12661}
12662impl GIMBAL_DEVICE_INFORMATION_DATA {
12663 pub const ENCODED_LEN: usize = 145usize;
12664 pub const DEFAULT: Self = Self {
12665 uid: 0_u64,
12666 time_boot_ms: 0_u32,
12667 firmware_version: 0_u32,
12668 hardware_version: 0_u32,
12669 roll_min: 0.0_f32,
12670 roll_max: 0.0_f32,
12671 pitch_min: 0.0_f32,
12672 pitch_max: 0.0_f32,
12673 yaw_min: 0.0_f32,
12674 yaw_max: 0.0_f32,
12675 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12676 custom_cap_flags: 0_u16,
12677 vendor_name: [0_u8; 32usize],
12678 model_name: [0_u8; 32usize],
12679 custom_name: [0_u8; 32usize],
12680 gimbal_device_id: 0_u8,
12681 };
12682 #[cfg(feature = "arbitrary")]
12683 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12684 use arbitrary::{Arbitrary, Unstructured};
12685 let mut buf = [0u8; 1024];
12686 rng.fill_bytes(&mut buf);
12687 let mut unstructured = Unstructured::new(&buf);
12688 Self::arbitrary(&mut unstructured).unwrap_or_default()
12689 }
12690}
12691impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12692 fn default() -> Self {
12693 Self::DEFAULT.clone()
12694 }
12695}
12696impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12697 type Message = MavMessage;
12698 const ID: u32 = 283u32;
12699 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12700 const EXTRA_CRC: u8 = 74u8;
12701 const ENCODED_LEN: usize = 145usize;
12702 fn deser(
12703 _version: MavlinkVersion,
12704 __input: &[u8],
12705 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12706 let avail_len = __input.len();
12707 let mut payload_buf = [0; Self::ENCODED_LEN];
12708 let mut buf = if avail_len < Self::ENCODED_LEN {
12709 payload_buf[0..avail_len].copy_from_slice(__input);
12710 Bytes::new(&payload_buf)
12711 } else {
12712 Bytes::new(__input)
12713 };
12714 let mut __struct = Self::default();
12715 __struct.uid = buf.get_u64_le();
12716 __struct.time_boot_ms = buf.get_u32_le();
12717 __struct.firmware_version = buf.get_u32_le();
12718 __struct.hardware_version = buf.get_u32_le();
12719 __struct.roll_min = buf.get_f32_le();
12720 __struct.roll_max = buf.get_f32_le();
12721 __struct.pitch_min = buf.get_f32_le();
12722 __struct.pitch_max = buf.get_f32_le();
12723 __struct.yaw_min = buf.get_f32_le();
12724 __struct.yaw_max = buf.get_f32_le();
12725 let tmp = buf.get_u16_le();
12726 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12727 tmp & GimbalDeviceCapFlags::all().bits(),
12728 )
12729 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12730 flag_type: "GimbalDeviceCapFlags",
12731 value: tmp as u32,
12732 })?;
12733 __struct.custom_cap_flags = buf.get_u16_le();
12734 for v in &mut __struct.vendor_name {
12735 let val = buf.get_u8();
12736 *v = val;
12737 }
12738 for v in &mut __struct.model_name {
12739 let val = buf.get_u8();
12740 *v = val;
12741 }
12742 for v in &mut __struct.custom_name {
12743 let val = buf.get_u8();
12744 *v = val;
12745 }
12746 __struct.gimbal_device_id = buf.get_u8();
12747 Ok(__struct)
12748 }
12749 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12750 let mut __tmp = BytesMut::new(bytes);
12751 #[allow(clippy::absurd_extreme_comparisons)]
12752 #[allow(unused_comparisons)]
12753 if __tmp.remaining() < Self::ENCODED_LEN {
12754 panic!(
12755 "buffer is too small (need {} bytes, but got {})",
12756 Self::ENCODED_LEN,
12757 __tmp.remaining(),
12758 )
12759 }
12760 __tmp.put_u64_le(self.uid);
12761 __tmp.put_u32_le(self.time_boot_ms);
12762 __tmp.put_u32_le(self.firmware_version);
12763 __tmp.put_u32_le(self.hardware_version);
12764 __tmp.put_f32_le(self.roll_min);
12765 __tmp.put_f32_le(self.roll_max);
12766 __tmp.put_f32_le(self.pitch_min);
12767 __tmp.put_f32_le(self.pitch_max);
12768 __tmp.put_f32_le(self.yaw_min);
12769 __tmp.put_f32_le(self.yaw_max);
12770 __tmp.put_u16_le(self.cap_flags.bits());
12771 __tmp.put_u16_le(self.custom_cap_flags);
12772 for val in &self.vendor_name {
12773 __tmp.put_u8(*val);
12774 }
12775 for val in &self.model_name {
12776 __tmp.put_u8(*val);
12777 }
12778 for val in &self.custom_name {
12779 __tmp.put_u8(*val);
12780 }
12781 if matches!(version, MavlinkVersion::V2) {
12782 __tmp.put_u8(self.gimbal_device_id);
12783 let len = __tmp.len();
12784 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12785 } else {
12786 __tmp.len()
12787 }
12788 }
12789}
12790#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12791#[doc = ""]
12792#[doc = "ID: 284"]
12793#[derive(Debug, Clone, PartialEq)]
12794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12796#[cfg_attr(feature = "ts", derive(TS))]
12797#[cfg_attr(feature = "ts", ts(export))]
12798pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12799 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12800 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12801 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12802 pub q: [f32; 4],
12803 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12804 pub angular_velocity_x: f32,
12805 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12806 pub angular_velocity_y: f32,
12807 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12808 pub angular_velocity_z: f32,
12809 #[doc = "Low level gimbal flags."]
12810 pub flags: GimbalDeviceFlags,
12811 #[doc = "System ID"]
12812 pub target_system: u8,
12813 #[doc = "Component ID"]
12814 pub target_component: u8,
12815}
12816impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12817 pub const ENCODED_LEN: usize = 32usize;
12818 pub const DEFAULT: Self = Self {
12819 q: [0.0_f32; 4usize],
12820 angular_velocity_x: 0.0_f32,
12821 angular_velocity_y: 0.0_f32,
12822 angular_velocity_z: 0.0_f32,
12823 flags: GimbalDeviceFlags::DEFAULT,
12824 target_system: 0_u8,
12825 target_component: 0_u8,
12826 };
12827 #[cfg(feature = "arbitrary")]
12828 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12829 use arbitrary::{Arbitrary, Unstructured};
12830 let mut buf = [0u8; 1024];
12831 rng.fill_bytes(&mut buf);
12832 let mut unstructured = Unstructured::new(&buf);
12833 Self::arbitrary(&mut unstructured).unwrap_or_default()
12834 }
12835}
12836impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12837 fn default() -> Self {
12838 Self::DEFAULT.clone()
12839 }
12840}
12841impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12842 type Message = MavMessage;
12843 const ID: u32 = 284u32;
12844 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12845 const EXTRA_CRC: u8 = 99u8;
12846 const ENCODED_LEN: usize = 32usize;
12847 fn deser(
12848 _version: MavlinkVersion,
12849 __input: &[u8],
12850 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12851 let avail_len = __input.len();
12852 let mut payload_buf = [0; Self::ENCODED_LEN];
12853 let mut buf = if avail_len < Self::ENCODED_LEN {
12854 payload_buf[0..avail_len].copy_from_slice(__input);
12855 Bytes::new(&payload_buf)
12856 } else {
12857 Bytes::new(__input)
12858 };
12859 let mut __struct = Self::default();
12860 for v in &mut __struct.q {
12861 let val = buf.get_f32_le();
12862 *v = val;
12863 }
12864 __struct.angular_velocity_x = buf.get_f32_le();
12865 __struct.angular_velocity_y = buf.get_f32_le();
12866 __struct.angular_velocity_z = buf.get_f32_le();
12867 let tmp = buf.get_u16_le();
12868 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12869 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12870 flag_type: "GimbalDeviceFlags",
12871 value: tmp as u32,
12872 })?;
12873 __struct.target_system = buf.get_u8();
12874 __struct.target_component = buf.get_u8();
12875 Ok(__struct)
12876 }
12877 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12878 let mut __tmp = BytesMut::new(bytes);
12879 #[allow(clippy::absurd_extreme_comparisons)]
12880 #[allow(unused_comparisons)]
12881 if __tmp.remaining() < Self::ENCODED_LEN {
12882 panic!(
12883 "buffer is too small (need {} bytes, but got {})",
12884 Self::ENCODED_LEN,
12885 __tmp.remaining(),
12886 )
12887 }
12888 for val in &self.q {
12889 __tmp.put_f32_le(*val);
12890 }
12891 __tmp.put_f32_le(self.angular_velocity_x);
12892 __tmp.put_f32_le(self.angular_velocity_y);
12893 __tmp.put_f32_le(self.angular_velocity_z);
12894 __tmp.put_u16_le(self.flags.bits());
12895 __tmp.put_u8(self.target_system);
12896 __tmp.put_u8(self.target_component);
12897 if matches!(version, MavlinkVersion::V2) {
12898 let len = __tmp.len();
12899 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12900 } else {
12901 __tmp.len()
12902 }
12903 }
12904}
12905#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12906#[doc = ""]
12907#[doc = "ID: 280"]
12908#[derive(Debug, Clone, PartialEq)]
12909#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12910#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12911#[cfg_attr(feature = "ts", derive(TS))]
12912#[cfg_attr(feature = "ts", ts(export))]
12913pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12914 #[doc = "Timestamp (time since system boot)."]
12915 pub time_boot_ms: u32,
12916 #[doc = "Bitmap of gimbal capability flags."]
12917 pub cap_flags: GimbalManagerCapFlags,
12918 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12919 pub roll_min: f32,
12920 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12921 pub roll_max: f32,
12922 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12923 pub pitch_min: f32,
12924 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12925 pub pitch_max: f32,
12926 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12927 pub yaw_min: f32,
12928 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12929 pub yaw_max: f32,
12930 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12931 pub gimbal_device_id: u8,
12932}
12933impl GIMBAL_MANAGER_INFORMATION_DATA {
12934 pub const ENCODED_LEN: usize = 33usize;
12935 pub const DEFAULT: Self = Self {
12936 time_boot_ms: 0_u32,
12937 cap_flags: GimbalManagerCapFlags::DEFAULT,
12938 roll_min: 0.0_f32,
12939 roll_max: 0.0_f32,
12940 pitch_min: 0.0_f32,
12941 pitch_max: 0.0_f32,
12942 yaw_min: 0.0_f32,
12943 yaw_max: 0.0_f32,
12944 gimbal_device_id: 0_u8,
12945 };
12946 #[cfg(feature = "arbitrary")]
12947 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12948 use arbitrary::{Arbitrary, Unstructured};
12949 let mut buf = [0u8; 1024];
12950 rng.fill_bytes(&mut buf);
12951 let mut unstructured = Unstructured::new(&buf);
12952 Self::arbitrary(&mut unstructured).unwrap_or_default()
12953 }
12954}
12955impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12956 fn default() -> Self {
12957 Self::DEFAULT.clone()
12958 }
12959}
12960impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12961 type Message = MavMessage;
12962 const ID: u32 = 280u32;
12963 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12964 const EXTRA_CRC: u8 = 70u8;
12965 const ENCODED_LEN: usize = 33usize;
12966 fn deser(
12967 _version: MavlinkVersion,
12968 __input: &[u8],
12969 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12970 let avail_len = __input.len();
12971 let mut payload_buf = [0; Self::ENCODED_LEN];
12972 let mut buf = if avail_len < Self::ENCODED_LEN {
12973 payload_buf[0..avail_len].copy_from_slice(__input);
12974 Bytes::new(&payload_buf)
12975 } else {
12976 Bytes::new(__input)
12977 };
12978 let mut __struct = Self::default();
12979 __struct.time_boot_ms = buf.get_u32_le();
12980 let tmp = buf.get_u32_le();
12981 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12982 tmp & GimbalManagerCapFlags::all().bits(),
12983 )
12984 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12985 flag_type: "GimbalManagerCapFlags",
12986 value: tmp as u32,
12987 })?;
12988 __struct.roll_min = buf.get_f32_le();
12989 __struct.roll_max = buf.get_f32_le();
12990 __struct.pitch_min = buf.get_f32_le();
12991 __struct.pitch_max = buf.get_f32_le();
12992 __struct.yaw_min = buf.get_f32_le();
12993 __struct.yaw_max = buf.get_f32_le();
12994 __struct.gimbal_device_id = buf.get_u8();
12995 Ok(__struct)
12996 }
12997 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12998 let mut __tmp = BytesMut::new(bytes);
12999 #[allow(clippy::absurd_extreme_comparisons)]
13000 #[allow(unused_comparisons)]
13001 if __tmp.remaining() < Self::ENCODED_LEN {
13002 panic!(
13003 "buffer is too small (need {} bytes, but got {})",
13004 Self::ENCODED_LEN,
13005 __tmp.remaining(),
13006 )
13007 }
13008 __tmp.put_u32_le(self.time_boot_ms);
13009 __tmp.put_u32_le(self.cap_flags.bits());
13010 __tmp.put_f32_le(self.roll_min);
13011 __tmp.put_f32_le(self.roll_max);
13012 __tmp.put_f32_le(self.pitch_min);
13013 __tmp.put_f32_le(self.pitch_max);
13014 __tmp.put_f32_le(self.yaw_min);
13015 __tmp.put_f32_le(self.yaw_max);
13016 __tmp.put_u8(self.gimbal_device_id);
13017 if matches!(version, MavlinkVersion::V2) {
13018 let len = __tmp.len();
13019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13020 } else {
13021 __tmp.len()
13022 }
13023 }
13024}
13025#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13026#[doc = ""]
13027#[doc = "ID: 282"]
13028#[derive(Debug, Clone, PartialEq)]
13029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13031#[cfg_attr(feature = "ts", derive(TS))]
13032#[cfg_attr(feature = "ts", ts(export))]
13033pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13034 #[doc = "High level gimbal manager flags to use."]
13035 pub flags: GimbalManagerFlags,
13036 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13037 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13038 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13039 pub q: [f32; 4],
13040 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13041 pub angular_velocity_x: f32,
13042 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13043 pub angular_velocity_y: f32,
13044 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13045 pub angular_velocity_z: f32,
13046 #[doc = "System ID"]
13047 pub target_system: u8,
13048 #[doc = "Component ID"]
13049 pub target_component: u8,
13050 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13051 pub gimbal_device_id: u8,
13052}
13053impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13054 pub const ENCODED_LEN: usize = 35usize;
13055 pub const DEFAULT: Self = Self {
13056 flags: GimbalManagerFlags::DEFAULT,
13057 q: [0.0_f32; 4usize],
13058 angular_velocity_x: 0.0_f32,
13059 angular_velocity_y: 0.0_f32,
13060 angular_velocity_z: 0.0_f32,
13061 target_system: 0_u8,
13062 target_component: 0_u8,
13063 gimbal_device_id: 0_u8,
13064 };
13065 #[cfg(feature = "arbitrary")]
13066 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13067 use arbitrary::{Arbitrary, Unstructured};
13068 let mut buf = [0u8; 1024];
13069 rng.fill_bytes(&mut buf);
13070 let mut unstructured = Unstructured::new(&buf);
13071 Self::arbitrary(&mut unstructured).unwrap_or_default()
13072 }
13073}
13074impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13075 fn default() -> Self {
13076 Self::DEFAULT.clone()
13077 }
13078}
13079impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13080 type Message = MavMessage;
13081 const ID: u32 = 282u32;
13082 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13083 const EXTRA_CRC: u8 = 123u8;
13084 const ENCODED_LEN: usize = 35usize;
13085 fn deser(
13086 _version: MavlinkVersion,
13087 __input: &[u8],
13088 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13089 let avail_len = __input.len();
13090 let mut payload_buf = [0; Self::ENCODED_LEN];
13091 let mut buf = if avail_len < Self::ENCODED_LEN {
13092 payload_buf[0..avail_len].copy_from_slice(__input);
13093 Bytes::new(&payload_buf)
13094 } else {
13095 Bytes::new(__input)
13096 };
13097 let mut __struct = Self::default();
13098 let tmp = buf.get_u32_le();
13099 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13100 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13101 flag_type: "GimbalManagerFlags",
13102 value: tmp as u32,
13103 })?;
13104 for v in &mut __struct.q {
13105 let val = buf.get_f32_le();
13106 *v = val;
13107 }
13108 __struct.angular_velocity_x = buf.get_f32_le();
13109 __struct.angular_velocity_y = buf.get_f32_le();
13110 __struct.angular_velocity_z = buf.get_f32_le();
13111 __struct.target_system = buf.get_u8();
13112 __struct.target_component = buf.get_u8();
13113 __struct.gimbal_device_id = buf.get_u8();
13114 Ok(__struct)
13115 }
13116 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13117 let mut __tmp = BytesMut::new(bytes);
13118 #[allow(clippy::absurd_extreme_comparisons)]
13119 #[allow(unused_comparisons)]
13120 if __tmp.remaining() < Self::ENCODED_LEN {
13121 panic!(
13122 "buffer is too small (need {} bytes, but got {})",
13123 Self::ENCODED_LEN,
13124 __tmp.remaining(),
13125 )
13126 }
13127 __tmp.put_u32_le(self.flags.bits());
13128 for val in &self.q {
13129 __tmp.put_f32_le(*val);
13130 }
13131 __tmp.put_f32_le(self.angular_velocity_x);
13132 __tmp.put_f32_le(self.angular_velocity_y);
13133 __tmp.put_f32_le(self.angular_velocity_z);
13134 __tmp.put_u8(self.target_system);
13135 __tmp.put_u8(self.target_component);
13136 __tmp.put_u8(self.gimbal_device_id);
13137 if matches!(version, MavlinkVersion::V2) {
13138 let len = __tmp.len();
13139 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13140 } else {
13141 __tmp.len()
13142 }
13143 }
13144}
13145#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13146#[doc = ""]
13147#[doc = "ID: 288"]
13148#[derive(Debug, Clone, PartialEq)]
13149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13150#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13151#[cfg_attr(feature = "ts", derive(TS))]
13152#[cfg_attr(feature = "ts", ts(export))]
13153pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13154 #[doc = "High level gimbal manager flags."]
13155 pub flags: GimbalManagerFlags,
13156 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13157 pub pitch: f32,
13158 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13159 pub yaw: f32,
13160 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13161 pub pitch_rate: f32,
13162 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13163 pub yaw_rate: f32,
13164 #[doc = "System ID"]
13165 pub target_system: u8,
13166 #[doc = "Component ID"]
13167 pub target_component: u8,
13168 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13169 pub gimbal_device_id: u8,
13170}
13171impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13172 pub const ENCODED_LEN: usize = 23usize;
13173 pub const DEFAULT: Self = Self {
13174 flags: GimbalManagerFlags::DEFAULT,
13175 pitch: 0.0_f32,
13176 yaw: 0.0_f32,
13177 pitch_rate: 0.0_f32,
13178 yaw_rate: 0.0_f32,
13179 target_system: 0_u8,
13180 target_component: 0_u8,
13181 gimbal_device_id: 0_u8,
13182 };
13183 #[cfg(feature = "arbitrary")]
13184 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13185 use arbitrary::{Arbitrary, Unstructured};
13186 let mut buf = [0u8; 1024];
13187 rng.fill_bytes(&mut buf);
13188 let mut unstructured = Unstructured::new(&buf);
13189 Self::arbitrary(&mut unstructured).unwrap_or_default()
13190 }
13191}
13192impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13193 fn default() -> Self {
13194 Self::DEFAULT.clone()
13195 }
13196}
13197impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13198 type Message = MavMessage;
13199 const ID: u32 = 288u32;
13200 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13201 const EXTRA_CRC: u8 = 20u8;
13202 const ENCODED_LEN: usize = 23usize;
13203 fn deser(
13204 _version: MavlinkVersion,
13205 __input: &[u8],
13206 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13207 let avail_len = __input.len();
13208 let mut payload_buf = [0; Self::ENCODED_LEN];
13209 let mut buf = if avail_len < Self::ENCODED_LEN {
13210 payload_buf[0..avail_len].copy_from_slice(__input);
13211 Bytes::new(&payload_buf)
13212 } else {
13213 Bytes::new(__input)
13214 };
13215 let mut __struct = Self::default();
13216 let tmp = buf.get_u32_le();
13217 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13218 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13219 flag_type: "GimbalManagerFlags",
13220 value: tmp as u32,
13221 })?;
13222 __struct.pitch = buf.get_f32_le();
13223 __struct.yaw = buf.get_f32_le();
13224 __struct.pitch_rate = buf.get_f32_le();
13225 __struct.yaw_rate = buf.get_f32_le();
13226 __struct.target_system = buf.get_u8();
13227 __struct.target_component = buf.get_u8();
13228 __struct.gimbal_device_id = buf.get_u8();
13229 Ok(__struct)
13230 }
13231 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13232 let mut __tmp = BytesMut::new(bytes);
13233 #[allow(clippy::absurd_extreme_comparisons)]
13234 #[allow(unused_comparisons)]
13235 if __tmp.remaining() < Self::ENCODED_LEN {
13236 panic!(
13237 "buffer is too small (need {} bytes, but got {})",
13238 Self::ENCODED_LEN,
13239 __tmp.remaining(),
13240 )
13241 }
13242 __tmp.put_u32_le(self.flags.bits());
13243 __tmp.put_f32_le(self.pitch);
13244 __tmp.put_f32_le(self.yaw);
13245 __tmp.put_f32_le(self.pitch_rate);
13246 __tmp.put_f32_le(self.yaw_rate);
13247 __tmp.put_u8(self.target_system);
13248 __tmp.put_u8(self.target_component);
13249 __tmp.put_u8(self.gimbal_device_id);
13250 if matches!(version, MavlinkVersion::V2) {
13251 let len = __tmp.len();
13252 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13253 } else {
13254 __tmp.len()
13255 }
13256 }
13257}
13258#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13259#[doc = ""]
13260#[doc = "ID: 287"]
13261#[derive(Debug, Clone, PartialEq)]
13262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13263#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13264#[cfg_attr(feature = "ts", derive(TS))]
13265#[cfg_attr(feature = "ts", ts(export))]
13266pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13267 #[doc = "High level gimbal manager flags to use."]
13268 pub flags: GimbalManagerFlags,
13269 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13270 pub pitch: f32,
13271 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13272 pub yaw: f32,
13273 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13274 pub pitch_rate: f32,
13275 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13276 pub yaw_rate: f32,
13277 #[doc = "System ID"]
13278 pub target_system: u8,
13279 #[doc = "Component ID"]
13280 pub target_component: u8,
13281 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13282 pub gimbal_device_id: u8,
13283}
13284impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13285 pub const ENCODED_LEN: usize = 23usize;
13286 pub const DEFAULT: Self = Self {
13287 flags: GimbalManagerFlags::DEFAULT,
13288 pitch: 0.0_f32,
13289 yaw: 0.0_f32,
13290 pitch_rate: 0.0_f32,
13291 yaw_rate: 0.0_f32,
13292 target_system: 0_u8,
13293 target_component: 0_u8,
13294 gimbal_device_id: 0_u8,
13295 };
13296 #[cfg(feature = "arbitrary")]
13297 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13298 use arbitrary::{Arbitrary, Unstructured};
13299 let mut buf = [0u8; 1024];
13300 rng.fill_bytes(&mut buf);
13301 let mut unstructured = Unstructured::new(&buf);
13302 Self::arbitrary(&mut unstructured).unwrap_or_default()
13303 }
13304}
13305impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13306 fn default() -> Self {
13307 Self::DEFAULT.clone()
13308 }
13309}
13310impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13311 type Message = MavMessage;
13312 const ID: u32 = 287u32;
13313 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13314 const EXTRA_CRC: u8 = 1u8;
13315 const ENCODED_LEN: usize = 23usize;
13316 fn deser(
13317 _version: MavlinkVersion,
13318 __input: &[u8],
13319 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13320 let avail_len = __input.len();
13321 let mut payload_buf = [0; Self::ENCODED_LEN];
13322 let mut buf = if avail_len < Self::ENCODED_LEN {
13323 payload_buf[0..avail_len].copy_from_slice(__input);
13324 Bytes::new(&payload_buf)
13325 } else {
13326 Bytes::new(__input)
13327 };
13328 let mut __struct = Self::default();
13329 let tmp = buf.get_u32_le();
13330 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13331 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13332 flag_type: "GimbalManagerFlags",
13333 value: tmp as u32,
13334 })?;
13335 __struct.pitch = buf.get_f32_le();
13336 __struct.yaw = buf.get_f32_le();
13337 __struct.pitch_rate = buf.get_f32_le();
13338 __struct.yaw_rate = buf.get_f32_le();
13339 __struct.target_system = buf.get_u8();
13340 __struct.target_component = buf.get_u8();
13341 __struct.gimbal_device_id = buf.get_u8();
13342 Ok(__struct)
13343 }
13344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13345 let mut __tmp = BytesMut::new(bytes);
13346 #[allow(clippy::absurd_extreme_comparisons)]
13347 #[allow(unused_comparisons)]
13348 if __tmp.remaining() < Self::ENCODED_LEN {
13349 panic!(
13350 "buffer is too small (need {} bytes, but got {})",
13351 Self::ENCODED_LEN,
13352 __tmp.remaining(),
13353 )
13354 }
13355 __tmp.put_u32_le(self.flags.bits());
13356 __tmp.put_f32_le(self.pitch);
13357 __tmp.put_f32_le(self.yaw);
13358 __tmp.put_f32_le(self.pitch_rate);
13359 __tmp.put_f32_le(self.yaw_rate);
13360 __tmp.put_u8(self.target_system);
13361 __tmp.put_u8(self.target_component);
13362 __tmp.put_u8(self.gimbal_device_id);
13363 if matches!(version, MavlinkVersion::V2) {
13364 let len = __tmp.len();
13365 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13366 } else {
13367 __tmp.len()
13368 }
13369 }
13370}
13371#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13372#[doc = ""]
13373#[doc = "ID: 281"]
13374#[derive(Debug, Clone, PartialEq)]
13375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13377#[cfg_attr(feature = "ts", derive(TS))]
13378#[cfg_attr(feature = "ts", ts(export))]
13379pub struct GIMBAL_MANAGER_STATUS_DATA {
13380 #[doc = "Timestamp (time since system boot)."]
13381 pub time_boot_ms: u32,
13382 #[doc = "High level gimbal manager flags currently applied."]
13383 pub flags: GimbalManagerFlags,
13384 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13385 pub gimbal_device_id: u8,
13386 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13387 pub primary_control_sysid: u8,
13388 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13389 pub primary_control_compid: u8,
13390 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13391 pub secondary_control_sysid: u8,
13392 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13393 pub secondary_control_compid: u8,
13394}
13395impl GIMBAL_MANAGER_STATUS_DATA {
13396 pub const ENCODED_LEN: usize = 13usize;
13397 pub const DEFAULT: Self = Self {
13398 time_boot_ms: 0_u32,
13399 flags: GimbalManagerFlags::DEFAULT,
13400 gimbal_device_id: 0_u8,
13401 primary_control_sysid: 0_u8,
13402 primary_control_compid: 0_u8,
13403 secondary_control_sysid: 0_u8,
13404 secondary_control_compid: 0_u8,
13405 };
13406 #[cfg(feature = "arbitrary")]
13407 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13408 use arbitrary::{Arbitrary, Unstructured};
13409 let mut buf = [0u8; 1024];
13410 rng.fill_bytes(&mut buf);
13411 let mut unstructured = Unstructured::new(&buf);
13412 Self::arbitrary(&mut unstructured).unwrap_or_default()
13413 }
13414}
13415impl Default for GIMBAL_MANAGER_STATUS_DATA {
13416 fn default() -> Self {
13417 Self::DEFAULT.clone()
13418 }
13419}
13420impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13421 type Message = MavMessage;
13422 const ID: u32 = 281u32;
13423 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13424 const EXTRA_CRC: u8 = 48u8;
13425 const ENCODED_LEN: usize = 13usize;
13426 fn deser(
13427 _version: MavlinkVersion,
13428 __input: &[u8],
13429 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13430 let avail_len = __input.len();
13431 let mut payload_buf = [0; Self::ENCODED_LEN];
13432 let mut buf = if avail_len < Self::ENCODED_LEN {
13433 payload_buf[0..avail_len].copy_from_slice(__input);
13434 Bytes::new(&payload_buf)
13435 } else {
13436 Bytes::new(__input)
13437 };
13438 let mut __struct = Self::default();
13439 __struct.time_boot_ms = buf.get_u32_le();
13440 let tmp = buf.get_u32_le();
13441 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13442 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13443 flag_type: "GimbalManagerFlags",
13444 value: tmp as u32,
13445 })?;
13446 __struct.gimbal_device_id = buf.get_u8();
13447 __struct.primary_control_sysid = buf.get_u8();
13448 __struct.primary_control_compid = buf.get_u8();
13449 __struct.secondary_control_sysid = buf.get_u8();
13450 __struct.secondary_control_compid = buf.get_u8();
13451 Ok(__struct)
13452 }
13453 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13454 let mut __tmp = BytesMut::new(bytes);
13455 #[allow(clippy::absurd_extreme_comparisons)]
13456 #[allow(unused_comparisons)]
13457 if __tmp.remaining() < Self::ENCODED_LEN {
13458 panic!(
13459 "buffer is too small (need {} bytes, but got {})",
13460 Self::ENCODED_LEN,
13461 __tmp.remaining(),
13462 )
13463 }
13464 __tmp.put_u32_le(self.time_boot_ms);
13465 __tmp.put_u32_le(self.flags.bits());
13466 __tmp.put_u8(self.gimbal_device_id);
13467 __tmp.put_u8(self.primary_control_sysid);
13468 __tmp.put_u8(self.primary_control_compid);
13469 __tmp.put_u8(self.secondary_control_sysid);
13470 __tmp.put_u8(self.secondary_control_compid);
13471 if matches!(version, MavlinkVersion::V2) {
13472 let len = __tmp.len();
13473 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13474 } else {
13475 __tmp.len()
13476 }
13477 }
13478}
13479#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13480#[doc = ""]
13481#[doc = "ID: 33"]
13482#[derive(Debug, Clone, PartialEq)]
13483#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13484#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13485#[cfg_attr(feature = "ts", derive(TS))]
13486#[cfg_attr(feature = "ts", ts(export))]
13487pub struct GLOBAL_POSITION_INT_DATA {
13488 #[doc = "Timestamp (time since system boot)."]
13489 pub time_boot_ms: u32,
13490 #[doc = "Latitude, expressed"]
13491 pub lat: i32,
13492 #[doc = "Longitude, expressed"]
13493 pub lon: i32,
13494 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13495 pub alt: i32,
13496 #[doc = "Altitude above home"]
13497 pub relative_alt: i32,
13498 #[doc = "Ground X Speed (Latitude, positive north)"]
13499 pub vx: i16,
13500 #[doc = "Ground Y Speed (Longitude, positive east)"]
13501 pub vy: i16,
13502 #[doc = "Ground Z Speed (Altitude, positive down)"]
13503 pub vz: i16,
13504 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13505 pub hdg: u16,
13506}
13507impl GLOBAL_POSITION_INT_DATA {
13508 pub const ENCODED_LEN: usize = 28usize;
13509 pub const DEFAULT: Self = Self {
13510 time_boot_ms: 0_u32,
13511 lat: 0_i32,
13512 lon: 0_i32,
13513 alt: 0_i32,
13514 relative_alt: 0_i32,
13515 vx: 0_i16,
13516 vy: 0_i16,
13517 vz: 0_i16,
13518 hdg: 0_u16,
13519 };
13520 #[cfg(feature = "arbitrary")]
13521 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13522 use arbitrary::{Arbitrary, Unstructured};
13523 let mut buf = [0u8; 1024];
13524 rng.fill_bytes(&mut buf);
13525 let mut unstructured = Unstructured::new(&buf);
13526 Self::arbitrary(&mut unstructured).unwrap_or_default()
13527 }
13528}
13529impl Default for GLOBAL_POSITION_INT_DATA {
13530 fn default() -> Self {
13531 Self::DEFAULT.clone()
13532 }
13533}
13534impl MessageData for GLOBAL_POSITION_INT_DATA {
13535 type Message = MavMessage;
13536 const ID: u32 = 33u32;
13537 const NAME: &'static str = "GLOBAL_POSITION_INT";
13538 const EXTRA_CRC: u8 = 104u8;
13539 const ENCODED_LEN: usize = 28usize;
13540 fn deser(
13541 _version: MavlinkVersion,
13542 __input: &[u8],
13543 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13544 let avail_len = __input.len();
13545 let mut payload_buf = [0; Self::ENCODED_LEN];
13546 let mut buf = if avail_len < Self::ENCODED_LEN {
13547 payload_buf[0..avail_len].copy_from_slice(__input);
13548 Bytes::new(&payload_buf)
13549 } else {
13550 Bytes::new(__input)
13551 };
13552 let mut __struct = Self::default();
13553 __struct.time_boot_ms = buf.get_u32_le();
13554 __struct.lat = buf.get_i32_le();
13555 __struct.lon = buf.get_i32_le();
13556 __struct.alt = buf.get_i32_le();
13557 __struct.relative_alt = buf.get_i32_le();
13558 __struct.vx = buf.get_i16_le();
13559 __struct.vy = buf.get_i16_le();
13560 __struct.vz = buf.get_i16_le();
13561 __struct.hdg = buf.get_u16_le();
13562 Ok(__struct)
13563 }
13564 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13565 let mut __tmp = BytesMut::new(bytes);
13566 #[allow(clippy::absurd_extreme_comparisons)]
13567 #[allow(unused_comparisons)]
13568 if __tmp.remaining() < Self::ENCODED_LEN {
13569 panic!(
13570 "buffer is too small (need {} bytes, but got {})",
13571 Self::ENCODED_LEN,
13572 __tmp.remaining(),
13573 )
13574 }
13575 __tmp.put_u32_le(self.time_boot_ms);
13576 __tmp.put_i32_le(self.lat);
13577 __tmp.put_i32_le(self.lon);
13578 __tmp.put_i32_le(self.alt);
13579 __tmp.put_i32_le(self.relative_alt);
13580 __tmp.put_i16_le(self.vx);
13581 __tmp.put_i16_le(self.vy);
13582 __tmp.put_i16_le(self.vz);
13583 __tmp.put_u16_le(self.hdg);
13584 if matches!(version, MavlinkVersion::V2) {
13585 let len = __tmp.len();
13586 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13587 } else {
13588 __tmp.len()
13589 }
13590 }
13591}
13592#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13593#[doc = ""]
13594#[doc = "ID: 63"]
13595#[derive(Debug, Clone, PartialEq)]
13596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13597#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13598#[cfg_attr(feature = "ts", derive(TS))]
13599#[cfg_attr(feature = "ts", ts(export))]
13600pub struct GLOBAL_POSITION_INT_COV_DATA {
13601 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13602 pub time_usec: u64,
13603 #[doc = "Latitude"]
13604 pub lat: i32,
13605 #[doc = "Longitude"]
13606 pub lon: i32,
13607 #[doc = "Altitude in meters above MSL"]
13608 pub alt: i32,
13609 #[doc = "Altitude above ground"]
13610 pub relative_alt: i32,
13611 #[doc = "Ground X Speed (Latitude)"]
13612 pub vx: f32,
13613 #[doc = "Ground Y Speed (Longitude)"]
13614 pub vy: f32,
13615 #[doc = "Ground Z Speed (Altitude)"]
13616 pub vz: f32,
13617 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13618 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13619 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13620 pub covariance: [f32; 36],
13621 #[doc = "Class id of the estimator this estimate originated from."]
13622 pub estimator_type: MavEstimatorType,
13623}
13624impl GLOBAL_POSITION_INT_COV_DATA {
13625 pub const ENCODED_LEN: usize = 181usize;
13626 pub const DEFAULT: Self = Self {
13627 time_usec: 0_u64,
13628 lat: 0_i32,
13629 lon: 0_i32,
13630 alt: 0_i32,
13631 relative_alt: 0_i32,
13632 vx: 0.0_f32,
13633 vy: 0.0_f32,
13634 vz: 0.0_f32,
13635 covariance: [0.0_f32; 36usize],
13636 estimator_type: MavEstimatorType::DEFAULT,
13637 };
13638 #[cfg(feature = "arbitrary")]
13639 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13640 use arbitrary::{Arbitrary, Unstructured};
13641 let mut buf = [0u8; 1024];
13642 rng.fill_bytes(&mut buf);
13643 let mut unstructured = Unstructured::new(&buf);
13644 Self::arbitrary(&mut unstructured).unwrap_or_default()
13645 }
13646}
13647impl Default for GLOBAL_POSITION_INT_COV_DATA {
13648 fn default() -> Self {
13649 Self::DEFAULT.clone()
13650 }
13651}
13652impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13653 type Message = MavMessage;
13654 const ID: u32 = 63u32;
13655 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13656 const EXTRA_CRC: u8 = 119u8;
13657 const ENCODED_LEN: usize = 181usize;
13658 fn deser(
13659 _version: MavlinkVersion,
13660 __input: &[u8],
13661 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13662 let avail_len = __input.len();
13663 let mut payload_buf = [0; Self::ENCODED_LEN];
13664 let mut buf = if avail_len < Self::ENCODED_LEN {
13665 payload_buf[0..avail_len].copy_from_slice(__input);
13666 Bytes::new(&payload_buf)
13667 } else {
13668 Bytes::new(__input)
13669 };
13670 let mut __struct = Self::default();
13671 __struct.time_usec = buf.get_u64_le();
13672 __struct.lat = buf.get_i32_le();
13673 __struct.lon = buf.get_i32_le();
13674 __struct.alt = buf.get_i32_le();
13675 __struct.relative_alt = buf.get_i32_le();
13676 __struct.vx = buf.get_f32_le();
13677 __struct.vy = buf.get_f32_le();
13678 __struct.vz = buf.get_f32_le();
13679 for v in &mut __struct.covariance {
13680 let val = buf.get_f32_le();
13681 *v = val;
13682 }
13683 let tmp = buf.get_u8();
13684 __struct.estimator_type =
13685 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13686 enum_type: "MavEstimatorType",
13687 value: tmp as u32,
13688 })?;
13689 Ok(__struct)
13690 }
13691 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13692 let mut __tmp = BytesMut::new(bytes);
13693 #[allow(clippy::absurd_extreme_comparisons)]
13694 #[allow(unused_comparisons)]
13695 if __tmp.remaining() < Self::ENCODED_LEN {
13696 panic!(
13697 "buffer is too small (need {} bytes, but got {})",
13698 Self::ENCODED_LEN,
13699 __tmp.remaining(),
13700 )
13701 }
13702 __tmp.put_u64_le(self.time_usec);
13703 __tmp.put_i32_le(self.lat);
13704 __tmp.put_i32_le(self.lon);
13705 __tmp.put_i32_le(self.alt);
13706 __tmp.put_i32_le(self.relative_alt);
13707 __tmp.put_f32_le(self.vx);
13708 __tmp.put_f32_le(self.vy);
13709 __tmp.put_f32_le(self.vz);
13710 for val in &self.covariance {
13711 __tmp.put_f32_le(*val);
13712 }
13713 __tmp.put_u8(self.estimator_type as u8);
13714 if matches!(version, MavlinkVersion::V2) {
13715 let len = __tmp.len();
13716 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13717 } else {
13718 __tmp.len()
13719 }
13720 }
13721}
13722#[doc = "Global position/attitude estimate from a vision source."]
13723#[doc = ""]
13724#[doc = "ID: 101"]
13725#[derive(Debug, Clone, PartialEq)]
13726#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13727#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13728#[cfg_attr(feature = "ts", derive(TS))]
13729#[cfg_attr(feature = "ts", ts(export))]
13730pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13731 #[doc = "Timestamp (UNIX time or since system boot)"]
13732 pub usec: u64,
13733 #[doc = "Global X position"]
13734 pub x: f32,
13735 #[doc = "Global Y position"]
13736 pub y: f32,
13737 #[doc = "Global Z position"]
13738 pub z: f32,
13739 #[doc = "Roll angle"]
13740 pub roll: f32,
13741 #[doc = "Pitch angle"]
13742 pub pitch: f32,
13743 #[doc = "Yaw angle"]
13744 pub yaw: f32,
13745 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13746 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13747 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13748 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13749 pub covariance: [f32; 21],
13750 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13751 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13752 pub reset_counter: u8,
13753}
13754impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13755 pub const ENCODED_LEN: usize = 117usize;
13756 pub const DEFAULT: Self = Self {
13757 usec: 0_u64,
13758 x: 0.0_f32,
13759 y: 0.0_f32,
13760 z: 0.0_f32,
13761 roll: 0.0_f32,
13762 pitch: 0.0_f32,
13763 yaw: 0.0_f32,
13764 covariance: [0.0_f32; 21usize],
13765 reset_counter: 0_u8,
13766 };
13767 #[cfg(feature = "arbitrary")]
13768 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13769 use arbitrary::{Arbitrary, Unstructured};
13770 let mut buf = [0u8; 1024];
13771 rng.fill_bytes(&mut buf);
13772 let mut unstructured = Unstructured::new(&buf);
13773 Self::arbitrary(&mut unstructured).unwrap_or_default()
13774 }
13775}
13776impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13777 fn default() -> Self {
13778 Self::DEFAULT.clone()
13779 }
13780}
13781impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13782 type Message = MavMessage;
13783 const ID: u32 = 101u32;
13784 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13785 const EXTRA_CRC: u8 = 102u8;
13786 const ENCODED_LEN: usize = 117usize;
13787 fn deser(
13788 _version: MavlinkVersion,
13789 __input: &[u8],
13790 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13791 let avail_len = __input.len();
13792 let mut payload_buf = [0; Self::ENCODED_LEN];
13793 let mut buf = if avail_len < Self::ENCODED_LEN {
13794 payload_buf[0..avail_len].copy_from_slice(__input);
13795 Bytes::new(&payload_buf)
13796 } else {
13797 Bytes::new(__input)
13798 };
13799 let mut __struct = Self::default();
13800 __struct.usec = buf.get_u64_le();
13801 __struct.x = buf.get_f32_le();
13802 __struct.y = buf.get_f32_le();
13803 __struct.z = buf.get_f32_le();
13804 __struct.roll = buf.get_f32_le();
13805 __struct.pitch = buf.get_f32_le();
13806 __struct.yaw = buf.get_f32_le();
13807 for v in &mut __struct.covariance {
13808 let val = buf.get_f32_le();
13809 *v = val;
13810 }
13811 __struct.reset_counter = buf.get_u8();
13812 Ok(__struct)
13813 }
13814 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13815 let mut __tmp = BytesMut::new(bytes);
13816 #[allow(clippy::absurd_extreme_comparisons)]
13817 #[allow(unused_comparisons)]
13818 if __tmp.remaining() < Self::ENCODED_LEN {
13819 panic!(
13820 "buffer is too small (need {} bytes, but got {})",
13821 Self::ENCODED_LEN,
13822 __tmp.remaining(),
13823 )
13824 }
13825 __tmp.put_u64_le(self.usec);
13826 __tmp.put_f32_le(self.x);
13827 __tmp.put_f32_le(self.y);
13828 __tmp.put_f32_le(self.z);
13829 __tmp.put_f32_le(self.roll);
13830 __tmp.put_f32_le(self.pitch);
13831 __tmp.put_f32_le(self.yaw);
13832 if matches!(version, MavlinkVersion::V2) {
13833 for val in &self.covariance {
13834 __tmp.put_f32_le(*val);
13835 }
13836 __tmp.put_u8(self.reset_counter);
13837 let len = __tmp.len();
13838 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13839 } else {
13840 __tmp.len()
13841 }
13842 }
13843}
13844#[doc = "Second GPS data."]
13845#[doc = ""]
13846#[doc = "ID: 124"]
13847#[derive(Debug, Clone, PartialEq)]
13848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13849#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13850#[cfg_attr(feature = "ts", derive(TS))]
13851#[cfg_attr(feature = "ts", ts(export))]
13852pub struct GPS2_RAW_DATA {
13853 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13854 pub time_usec: u64,
13855 #[doc = "Latitude (WGS84)"]
13856 pub lat: i32,
13857 #[doc = "Longitude (WGS84)"]
13858 pub lon: i32,
13859 #[doc = "Altitude (MSL). Positive for up."]
13860 pub alt: i32,
13861 #[doc = "Age of DGPS info"]
13862 pub dgps_age: u32,
13863 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13864 pub eph: u16,
13865 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13866 pub epv: u16,
13867 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13868 pub vel: u16,
13869 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13870 pub cog: u16,
13871 #[doc = "GPS fix type."]
13872 pub fix_type: GpsFixType,
13873 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13874 pub satellites_visible: u8,
13875 #[doc = "Number of DGPS satellites"]
13876 pub dgps_numch: u8,
13877 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13878 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13879 pub yaw: u16,
13880 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13881 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13882 pub alt_ellipsoid: i32,
13883 #[doc = "Position uncertainty."]
13884 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13885 pub h_acc: u32,
13886 #[doc = "Altitude uncertainty."]
13887 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13888 pub v_acc: u32,
13889 #[doc = "Speed uncertainty."]
13890 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13891 pub vel_acc: u32,
13892 #[doc = "Heading / track uncertainty"]
13893 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13894 pub hdg_acc: u32,
13895}
13896impl GPS2_RAW_DATA {
13897 pub const ENCODED_LEN: usize = 57usize;
13898 pub const DEFAULT: Self = Self {
13899 time_usec: 0_u64,
13900 lat: 0_i32,
13901 lon: 0_i32,
13902 alt: 0_i32,
13903 dgps_age: 0_u32,
13904 eph: 0_u16,
13905 epv: 0_u16,
13906 vel: 0_u16,
13907 cog: 0_u16,
13908 fix_type: GpsFixType::DEFAULT,
13909 satellites_visible: 0_u8,
13910 dgps_numch: 0_u8,
13911 yaw: 0_u16,
13912 alt_ellipsoid: 0_i32,
13913 h_acc: 0_u32,
13914 v_acc: 0_u32,
13915 vel_acc: 0_u32,
13916 hdg_acc: 0_u32,
13917 };
13918 #[cfg(feature = "arbitrary")]
13919 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13920 use arbitrary::{Arbitrary, Unstructured};
13921 let mut buf = [0u8; 1024];
13922 rng.fill_bytes(&mut buf);
13923 let mut unstructured = Unstructured::new(&buf);
13924 Self::arbitrary(&mut unstructured).unwrap_or_default()
13925 }
13926}
13927impl Default for GPS2_RAW_DATA {
13928 fn default() -> Self {
13929 Self::DEFAULT.clone()
13930 }
13931}
13932impl MessageData for GPS2_RAW_DATA {
13933 type Message = MavMessage;
13934 const ID: u32 = 124u32;
13935 const NAME: &'static str = "GPS2_RAW";
13936 const EXTRA_CRC: u8 = 87u8;
13937 const ENCODED_LEN: usize = 57usize;
13938 fn deser(
13939 _version: MavlinkVersion,
13940 __input: &[u8],
13941 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13942 let avail_len = __input.len();
13943 let mut payload_buf = [0; Self::ENCODED_LEN];
13944 let mut buf = if avail_len < Self::ENCODED_LEN {
13945 payload_buf[0..avail_len].copy_from_slice(__input);
13946 Bytes::new(&payload_buf)
13947 } else {
13948 Bytes::new(__input)
13949 };
13950 let mut __struct = Self::default();
13951 __struct.time_usec = buf.get_u64_le();
13952 __struct.lat = buf.get_i32_le();
13953 __struct.lon = buf.get_i32_le();
13954 __struct.alt = buf.get_i32_le();
13955 __struct.dgps_age = buf.get_u32_le();
13956 __struct.eph = buf.get_u16_le();
13957 __struct.epv = buf.get_u16_le();
13958 __struct.vel = buf.get_u16_le();
13959 __struct.cog = buf.get_u16_le();
13960 let tmp = buf.get_u8();
13961 __struct.fix_type =
13962 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13963 enum_type: "GpsFixType",
13964 value: tmp as u32,
13965 })?;
13966 __struct.satellites_visible = buf.get_u8();
13967 __struct.dgps_numch = buf.get_u8();
13968 __struct.yaw = buf.get_u16_le();
13969 __struct.alt_ellipsoid = buf.get_i32_le();
13970 __struct.h_acc = buf.get_u32_le();
13971 __struct.v_acc = buf.get_u32_le();
13972 __struct.vel_acc = buf.get_u32_le();
13973 __struct.hdg_acc = buf.get_u32_le();
13974 Ok(__struct)
13975 }
13976 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13977 let mut __tmp = BytesMut::new(bytes);
13978 #[allow(clippy::absurd_extreme_comparisons)]
13979 #[allow(unused_comparisons)]
13980 if __tmp.remaining() < Self::ENCODED_LEN {
13981 panic!(
13982 "buffer is too small (need {} bytes, but got {})",
13983 Self::ENCODED_LEN,
13984 __tmp.remaining(),
13985 )
13986 }
13987 __tmp.put_u64_le(self.time_usec);
13988 __tmp.put_i32_le(self.lat);
13989 __tmp.put_i32_le(self.lon);
13990 __tmp.put_i32_le(self.alt);
13991 __tmp.put_u32_le(self.dgps_age);
13992 __tmp.put_u16_le(self.eph);
13993 __tmp.put_u16_le(self.epv);
13994 __tmp.put_u16_le(self.vel);
13995 __tmp.put_u16_le(self.cog);
13996 __tmp.put_u8(self.fix_type as u8);
13997 __tmp.put_u8(self.satellites_visible);
13998 __tmp.put_u8(self.dgps_numch);
13999 if matches!(version, MavlinkVersion::V2) {
14000 __tmp.put_u16_le(self.yaw);
14001 __tmp.put_i32_le(self.alt_ellipsoid);
14002 __tmp.put_u32_le(self.h_acc);
14003 __tmp.put_u32_le(self.v_acc);
14004 __tmp.put_u32_le(self.vel_acc);
14005 __tmp.put_u32_le(self.hdg_acc);
14006 let len = __tmp.len();
14007 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14008 } else {
14009 __tmp.len()
14010 }
14011 }
14012}
14013#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14014#[doc = ""]
14015#[doc = "ID: 128"]
14016#[derive(Debug, Clone, PartialEq)]
14017#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14018#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14019#[cfg_attr(feature = "ts", derive(TS))]
14020#[cfg_attr(feature = "ts", ts(export))]
14021pub struct GPS2_RTK_DATA {
14022 #[doc = "Time since boot of last baseline message received."]
14023 pub time_last_baseline_ms: u32,
14024 #[doc = "GPS Time of Week of last baseline"]
14025 pub tow: u32,
14026 #[doc = "Current baseline in ECEF x or NED north component."]
14027 pub baseline_a_mm: i32,
14028 #[doc = "Current baseline in ECEF y or NED east component."]
14029 pub baseline_b_mm: i32,
14030 #[doc = "Current baseline in ECEF z or NED down component."]
14031 pub baseline_c_mm: i32,
14032 #[doc = "Current estimate of baseline accuracy."]
14033 pub accuracy: u32,
14034 #[doc = "Current number of integer ambiguity hypotheses."]
14035 pub iar_num_hypotheses: i32,
14036 #[doc = "GPS Week Number of last baseline"]
14037 pub wn: u16,
14038 #[doc = "Identification of connected RTK receiver."]
14039 pub rtk_receiver_id: u8,
14040 #[doc = "GPS-specific health report for RTK data."]
14041 pub rtk_health: u8,
14042 #[doc = "Rate of baseline messages being received by GPS"]
14043 pub rtk_rate: u8,
14044 #[doc = "Current number of sats used for RTK calculation."]
14045 pub nsats: u8,
14046 #[doc = "Coordinate system of baseline"]
14047 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14048}
14049impl GPS2_RTK_DATA {
14050 pub const ENCODED_LEN: usize = 35usize;
14051 pub const DEFAULT: Self = Self {
14052 time_last_baseline_ms: 0_u32,
14053 tow: 0_u32,
14054 baseline_a_mm: 0_i32,
14055 baseline_b_mm: 0_i32,
14056 baseline_c_mm: 0_i32,
14057 accuracy: 0_u32,
14058 iar_num_hypotheses: 0_i32,
14059 wn: 0_u16,
14060 rtk_receiver_id: 0_u8,
14061 rtk_health: 0_u8,
14062 rtk_rate: 0_u8,
14063 nsats: 0_u8,
14064 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14065 };
14066 #[cfg(feature = "arbitrary")]
14067 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14068 use arbitrary::{Arbitrary, Unstructured};
14069 let mut buf = [0u8; 1024];
14070 rng.fill_bytes(&mut buf);
14071 let mut unstructured = Unstructured::new(&buf);
14072 Self::arbitrary(&mut unstructured).unwrap_or_default()
14073 }
14074}
14075impl Default for GPS2_RTK_DATA {
14076 fn default() -> Self {
14077 Self::DEFAULT.clone()
14078 }
14079}
14080impl MessageData for GPS2_RTK_DATA {
14081 type Message = MavMessage;
14082 const ID: u32 = 128u32;
14083 const NAME: &'static str = "GPS2_RTK";
14084 const EXTRA_CRC: u8 = 226u8;
14085 const ENCODED_LEN: usize = 35usize;
14086 fn deser(
14087 _version: MavlinkVersion,
14088 __input: &[u8],
14089 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14090 let avail_len = __input.len();
14091 let mut payload_buf = [0; Self::ENCODED_LEN];
14092 let mut buf = if avail_len < Self::ENCODED_LEN {
14093 payload_buf[0..avail_len].copy_from_slice(__input);
14094 Bytes::new(&payload_buf)
14095 } else {
14096 Bytes::new(__input)
14097 };
14098 let mut __struct = Self::default();
14099 __struct.time_last_baseline_ms = buf.get_u32_le();
14100 __struct.tow = buf.get_u32_le();
14101 __struct.baseline_a_mm = buf.get_i32_le();
14102 __struct.baseline_b_mm = buf.get_i32_le();
14103 __struct.baseline_c_mm = buf.get_i32_le();
14104 __struct.accuracy = buf.get_u32_le();
14105 __struct.iar_num_hypotheses = buf.get_i32_le();
14106 __struct.wn = buf.get_u16_le();
14107 __struct.rtk_receiver_id = buf.get_u8();
14108 __struct.rtk_health = buf.get_u8();
14109 __struct.rtk_rate = buf.get_u8();
14110 __struct.nsats = buf.get_u8();
14111 let tmp = buf.get_u8();
14112 __struct.baseline_coords_type =
14113 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14114 enum_type: "RtkBaselineCoordinateSystem",
14115 value: tmp as u32,
14116 })?;
14117 Ok(__struct)
14118 }
14119 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14120 let mut __tmp = BytesMut::new(bytes);
14121 #[allow(clippy::absurd_extreme_comparisons)]
14122 #[allow(unused_comparisons)]
14123 if __tmp.remaining() < Self::ENCODED_LEN {
14124 panic!(
14125 "buffer is too small (need {} bytes, but got {})",
14126 Self::ENCODED_LEN,
14127 __tmp.remaining(),
14128 )
14129 }
14130 __tmp.put_u32_le(self.time_last_baseline_ms);
14131 __tmp.put_u32_le(self.tow);
14132 __tmp.put_i32_le(self.baseline_a_mm);
14133 __tmp.put_i32_le(self.baseline_b_mm);
14134 __tmp.put_i32_le(self.baseline_c_mm);
14135 __tmp.put_u32_le(self.accuracy);
14136 __tmp.put_i32_le(self.iar_num_hypotheses);
14137 __tmp.put_u16_le(self.wn);
14138 __tmp.put_u8(self.rtk_receiver_id);
14139 __tmp.put_u8(self.rtk_health);
14140 __tmp.put_u8(self.rtk_rate);
14141 __tmp.put_u8(self.nsats);
14142 __tmp.put_u8(self.baseline_coords_type as u8);
14143 if matches!(version, MavlinkVersion::V2) {
14144 let len = __tmp.len();
14145 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14146 } else {
14147 __tmp.len()
14148 }
14149 }
14150}
14151#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14152#[doc = ""]
14153#[doc = "ID: 49"]
14154#[derive(Debug, Clone, PartialEq)]
14155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14157#[cfg_attr(feature = "ts", derive(TS))]
14158#[cfg_attr(feature = "ts", ts(export))]
14159pub struct GPS_GLOBAL_ORIGIN_DATA {
14160 #[doc = "Latitude (WGS84)"]
14161 pub latitude: i32,
14162 #[doc = "Longitude (WGS84)"]
14163 pub longitude: i32,
14164 #[doc = "Altitude (MSL). Positive for up."]
14165 pub altitude: i32,
14166 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14167 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14168 pub time_usec: u64,
14169}
14170impl GPS_GLOBAL_ORIGIN_DATA {
14171 pub const ENCODED_LEN: usize = 20usize;
14172 pub const DEFAULT: Self = Self {
14173 latitude: 0_i32,
14174 longitude: 0_i32,
14175 altitude: 0_i32,
14176 time_usec: 0_u64,
14177 };
14178 #[cfg(feature = "arbitrary")]
14179 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14180 use arbitrary::{Arbitrary, Unstructured};
14181 let mut buf = [0u8; 1024];
14182 rng.fill_bytes(&mut buf);
14183 let mut unstructured = Unstructured::new(&buf);
14184 Self::arbitrary(&mut unstructured).unwrap_or_default()
14185 }
14186}
14187impl Default for GPS_GLOBAL_ORIGIN_DATA {
14188 fn default() -> Self {
14189 Self::DEFAULT.clone()
14190 }
14191}
14192impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14193 type Message = MavMessage;
14194 const ID: u32 = 49u32;
14195 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14196 const EXTRA_CRC: u8 = 39u8;
14197 const ENCODED_LEN: usize = 20usize;
14198 fn deser(
14199 _version: MavlinkVersion,
14200 __input: &[u8],
14201 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14202 let avail_len = __input.len();
14203 let mut payload_buf = [0; Self::ENCODED_LEN];
14204 let mut buf = if avail_len < Self::ENCODED_LEN {
14205 payload_buf[0..avail_len].copy_from_slice(__input);
14206 Bytes::new(&payload_buf)
14207 } else {
14208 Bytes::new(__input)
14209 };
14210 let mut __struct = Self::default();
14211 __struct.latitude = buf.get_i32_le();
14212 __struct.longitude = buf.get_i32_le();
14213 __struct.altitude = buf.get_i32_le();
14214 __struct.time_usec = buf.get_u64_le();
14215 Ok(__struct)
14216 }
14217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14218 let mut __tmp = BytesMut::new(bytes);
14219 #[allow(clippy::absurd_extreme_comparisons)]
14220 #[allow(unused_comparisons)]
14221 if __tmp.remaining() < Self::ENCODED_LEN {
14222 panic!(
14223 "buffer is too small (need {} bytes, but got {})",
14224 Self::ENCODED_LEN,
14225 __tmp.remaining(),
14226 )
14227 }
14228 __tmp.put_i32_le(self.latitude);
14229 __tmp.put_i32_le(self.longitude);
14230 __tmp.put_i32_le(self.altitude);
14231 if matches!(version, MavlinkVersion::V2) {
14232 __tmp.put_u64_le(self.time_usec);
14233 let len = __tmp.len();
14234 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14235 } else {
14236 __tmp.len()
14237 }
14238 }
14239}
14240#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14241#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14242#[doc = ""]
14243#[doc = "ID: 123"]
14244#[derive(Debug, Clone, PartialEq)]
14245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14246#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14247#[cfg_attr(feature = "ts", derive(TS))]
14248#[cfg_attr(feature = "ts", ts(export))]
14249pub struct GPS_INJECT_DATA_DATA {
14250 #[doc = "System ID"]
14251 pub target_system: u8,
14252 #[doc = "Component ID"]
14253 pub target_component: u8,
14254 #[doc = "Data length"]
14255 pub len: u8,
14256 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14257 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14258 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14259 pub data: [u8; 110],
14260}
14261impl GPS_INJECT_DATA_DATA {
14262 pub const ENCODED_LEN: usize = 113usize;
14263 pub const DEFAULT: Self = Self {
14264 target_system: 0_u8,
14265 target_component: 0_u8,
14266 len: 0_u8,
14267 data: [0_u8; 110usize],
14268 };
14269 #[cfg(feature = "arbitrary")]
14270 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14271 use arbitrary::{Arbitrary, Unstructured};
14272 let mut buf = [0u8; 1024];
14273 rng.fill_bytes(&mut buf);
14274 let mut unstructured = Unstructured::new(&buf);
14275 Self::arbitrary(&mut unstructured).unwrap_or_default()
14276 }
14277}
14278impl Default for GPS_INJECT_DATA_DATA {
14279 fn default() -> Self {
14280 Self::DEFAULT.clone()
14281 }
14282}
14283impl MessageData for GPS_INJECT_DATA_DATA {
14284 type Message = MavMessage;
14285 const ID: u32 = 123u32;
14286 const NAME: &'static str = "GPS_INJECT_DATA";
14287 const EXTRA_CRC: u8 = 250u8;
14288 const ENCODED_LEN: usize = 113usize;
14289 fn deser(
14290 _version: MavlinkVersion,
14291 __input: &[u8],
14292 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14293 let avail_len = __input.len();
14294 let mut payload_buf = [0; Self::ENCODED_LEN];
14295 let mut buf = if avail_len < Self::ENCODED_LEN {
14296 payload_buf[0..avail_len].copy_from_slice(__input);
14297 Bytes::new(&payload_buf)
14298 } else {
14299 Bytes::new(__input)
14300 };
14301 let mut __struct = Self::default();
14302 __struct.target_system = buf.get_u8();
14303 __struct.target_component = buf.get_u8();
14304 __struct.len = buf.get_u8();
14305 for v in &mut __struct.data {
14306 let val = buf.get_u8();
14307 *v = val;
14308 }
14309 Ok(__struct)
14310 }
14311 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14312 let mut __tmp = BytesMut::new(bytes);
14313 #[allow(clippy::absurd_extreme_comparisons)]
14314 #[allow(unused_comparisons)]
14315 if __tmp.remaining() < Self::ENCODED_LEN {
14316 panic!(
14317 "buffer is too small (need {} bytes, but got {})",
14318 Self::ENCODED_LEN,
14319 __tmp.remaining(),
14320 )
14321 }
14322 __tmp.put_u8(self.target_system);
14323 __tmp.put_u8(self.target_component);
14324 __tmp.put_u8(self.len);
14325 for val in &self.data {
14326 __tmp.put_u8(*val);
14327 }
14328 if matches!(version, MavlinkVersion::V2) {
14329 let len = __tmp.len();
14330 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14331 } else {
14332 __tmp.len()
14333 }
14334 }
14335}
14336#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14337#[doc = ""]
14338#[doc = "ID: 232"]
14339#[derive(Debug, Clone, PartialEq)]
14340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14342#[cfg_attr(feature = "ts", derive(TS))]
14343#[cfg_attr(feature = "ts", ts(export))]
14344pub struct GPS_INPUT_DATA {
14345 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14346 pub time_usec: u64,
14347 #[doc = "GPS time (from start of GPS week)"]
14348 pub time_week_ms: u32,
14349 #[doc = "Latitude (WGS84)"]
14350 pub lat: i32,
14351 #[doc = "Longitude (WGS84)"]
14352 pub lon: i32,
14353 #[doc = "Altitude (MSL). Positive for up."]
14354 pub alt: f32,
14355 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14356 pub hdop: f32,
14357 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14358 pub vdop: f32,
14359 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14360 pub vn: f32,
14361 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14362 pub ve: f32,
14363 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14364 pub vd: f32,
14365 #[doc = "GPS speed accuracy"]
14366 pub speed_accuracy: f32,
14367 #[doc = "GPS horizontal accuracy"]
14368 pub horiz_accuracy: f32,
14369 #[doc = "GPS vertical accuracy"]
14370 pub vert_accuracy: f32,
14371 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14372 pub ignore_flags: GpsInputIgnoreFlags,
14373 #[doc = "GPS week number"]
14374 pub time_week: u16,
14375 #[doc = "ID of the GPS for multiple GPS inputs"]
14376 pub gps_id: u8,
14377 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14378 pub fix_type: u8,
14379 #[doc = "Number of satellites visible."]
14380 pub satellites_visible: u8,
14381 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14382 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14383 pub yaw: u16,
14384}
14385impl GPS_INPUT_DATA {
14386 pub const ENCODED_LEN: usize = 65usize;
14387 pub const DEFAULT: Self = Self {
14388 time_usec: 0_u64,
14389 time_week_ms: 0_u32,
14390 lat: 0_i32,
14391 lon: 0_i32,
14392 alt: 0.0_f32,
14393 hdop: 0.0_f32,
14394 vdop: 0.0_f32,
14395 vn: 0.0_f32,
14396 ve: 0.0_f32,
14397 vd: 0.0_f32,
14398 speed_accuracy: 0.0_f32,
14399 horiz_accuracy: 0.0_f32,
14400 vert_accuracy: 0.0_f32,
14401 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14402 time_week: 0_u16,
14403 gps_id: 0_u8,
14404 fix_type: 0_u8,
14405 satellites_visible: 0_u8,
14406 yaw: 0_u16,
14407 };
14408 #[cfg(feature = "arbitrary")]
14409 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14410 use arbitrary::{Arbitrary, Unstructured};
14411 let mut buf = [0u8; 1024];
14412 rng.fill_bytes(&mut buf);
14413 let mut unstructured = Unstructured::new(&buf);
14414 Self::arbitrary(&mut unstructured).unwrap_or_default()
14415 }
14416}
14417impl Default for GPS_INPUT_DATA {
14418 fn default() -> Self {
14419 Self::DEFAULT.clone()
14420 }
14421}
14422impl MessageData for GPS_INPUT_DATA {
14423 type Message = MavMessage;
14424 const ID: u32 = 232u32;
14425 const NAME: &'static str = "GPS_INPUT";
14426 const EXTRA_CRC: u8 = 151u8;
14427 const ENCODED_LEN: usize = 65usize;
14428 fn deser(
14429 _version: MavlinkVersion,
14430 __input: &[u8],
14431 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14432 let avail_len = __input.len();
14433 let mut payload_buf = [0; Self::ENCODED_LEN];
14434 let mut buf = if avail_len < Self::ENCODED_LEN {
14435 payload_buf[0..avail_len].copy_from_slice(__input);
14436 Bytes::new(&payload_buf)
14437 } else {
14438 Bytes::new(__input)
14439 };
14440 let mut __struct = Self::default();
14441 __struct.time_usec = buf.get_u64_le();
14442 __struct.time_week_ms = buf.get_u32_le();
14443 __struct.lat = buf.get_i32_le();
14444 __struct.lon = buf.get_i32_le();
14445 __struct.alt = buf.get_f32_le();
14446 __struct.hdop = buf.get_f32_le();
14447 __struct.vdop = buf.get_f32_le();
14448 __struct.vn = buf.get_f32_le();
14449 __struct.ve = buf.get_f32_le();
14450 __struct.vd = buf.get_f32_le();
14451 __struct.speed_accuracy = buf.get_f32_le();
14452 __struct.horiz_accuracy = buf.get_f32_le();
14453 __struct.vert_accuracy = buf.get_f32_le();
14454 let tmp = buf.get_u16_le();
14455 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14456 tmp & GpsInputIgnoreFlags::all().bits(),
14457 )
14458 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14459 flag_type: "GpsInputIgnoreFlags",
14460 value: tmp as u32,
14461 })?;
14462 __struct.time_week = buf.get_u16_le();
14463 __struct.gps_id = buf.get_u8();
14464 __struct.fix_type = buf.get_u8();
14465 __struct.satellites_visible = buf.get_u8();
14466 __struct.yaw = buf.get_u16_le();
14467 Ok(__struct)
14468 }
14469 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14470 let mut __tmp = BytesMut::new(bytes);
14471 #[allow(clippy::absurd_extreme_comparisons)]
14472 #[allow(unused_comparisons)]
14473 if __tmp.remaining() < Self::ENCODED_LEN {
14474 panic!(
14475 "buffer is too small (need {} bytes, but got {})",
14476 Self::ENCODED_LEN,
14477 __tmp.remaining(),
14478 )
14479 }
14480 __tmp.put_u64_le(self.time_usec);
14481 __tmp.put_u32_le(self.time_week_ms);
14482 __tmp.put_i32_le(self.lat);
14483 __tmp.put_i32_le(self.lon);
14484 __tmp.put_f32_le(self.alt);
14485 __tmp.put_f32_le(self.hdop);
14486 __tmp.put_f32_le(self.vdop);
14487 __tmp.put_f32_le(self.vn);
14488 __tmp.put_f32_le(self.ve);
14489 __tmp.put_f32_le(self.vd);
14490 __tmp.put_f32_le(self.speed_accuracy);
14491 __tmp.put_f32_le(self.horiz_accuracy);
14492 __tmp.put_f32_le(self.vert_accuracy);
14493 __tmp.put_u16_le(self.ignore_flags.bits());
14494 __tmp.put_u16_le(self.time_week);
14495 __tmp.put_u8(self.gps_id);
14496 __tmp.put_u8(self.fix_type);
14497 __tmp.put_u8(self.satellites_visible);
14498 if matches!(version, MavlinkVersion::V2) {
14499 __tmp.put_u16_le(self.yaw);
14500 let len = __tmp.len();
14501 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14502 } else {
14503 __tmp.len()
14504 }
14505 }
14506}
14507#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14508#[doc = ""]
14509#[doc = "ID: 24"]
14510#[derive(Debug, Clone, PartialEq)]
14511#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14512#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14513#[cfg_attr(feature = "ts", derive(TS))]
14514#[cfg_attr(feature = "ts", ts(export))]
14515pub struct GPS_RAW_INT_DATA {
14516 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14517 pub time_usec: u64,
14518 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14519 pub lat: i32,
14520 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14521 pub lon: i32,
14522 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14523 pub alt: i32,
14524 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14525 pub eph: u16,
14526 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14527 pub epv: u16,
14528 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14529 pub vel: u16,
14530 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14531 pub cog: u16,
14532 #[doc = "GPS fix type."]
14533 pub fix_type: GpsFixType,
14534 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14535 pub satellites_visible: u8,
14536 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14537 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14538 pub alt_ellipsoid: i32,
14539 #[doc = "Position uncertainty."]
14540 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14541 pub h_acc: u32,
14542 #[doc = "Altitude uncertainty."]
14543 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14544 pub v_acc: u32,
14545 #[doc = "Speed uncertainty."]
14546 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14547 pub vel_acc: u32,
14548 #[doc = "Heading / track uncertainty"]
14549 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14550 pub hdg_acc: u32,
14551 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14552 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14553 pub yaw: u16,
14554}
14555impl GPS_RAW_INT_DATA {
14556 pub const ENCODED_LEN: usize = 52usize;
14557 pub const DEFAULT: Self = Self {
14558 time_usec: 0_u64,
14559 lat: 0_i32,
14560 lon: 0_i32,
14561 alt: 0_i32,
14562 eph: 0_u16,
14563 epv: 0_u16,
14564 vel: 0_u16,
14565 cog: 0_u16,
14566 fix_type: GpsFixType::DEFAULT,
14567 satellites_visible: 0_u8,
14568 alt_ellipsoid: 0_i32,
14569 h_acc: 0_u32,
14570 v_acc: 0_u32,
14571 vel_acc: 0_u32,
14572 hdg_acc: 0_u32,
14573 yaw: 0_u16,
14574 };
14575 #[cfg(feature = "arbitrary")]
14576 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14577 use arbitrary::{Arbitrary, Unstructured};
14578 let mut buf = [0u8; 1024];
14579 rng.fill_bytes(&mut buf);
14580 let mut unstructured = Unstructured::new(&buf);
14581 Self::arbitrary(&mut unstructured).unwrap_or_default()
14582 }
14583}
14584impl Default for GPS_RAW_INT_DATA {
14585 fn default() -> Self {
14586 Self::DEFAULT.clone()
14587 }
14588}
14589impl MessageData for GPS_RAW_INT_DATA {
14590 type Message = MavMessage;
14591 const ID: u32 = 24u32;
14592 const NAME: &'static str = "GPS_RAW_INT";
14593 const EXTRA_CRC: u8 = 24u8;
14594 const ENCODED_LEN: usize = 52usize;
14595 fn deser(
14596 _version: MavlinkVersion,
14597 __input: &[u8],
14598 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14599 let avail_len = __input.len();
14600 let mut payload_buf = [0; Self::ENCODED_LEN];
14601 let mut buf = if avail_len < Self::ENCODED_LEN {
14602 payload_buf[0..avail_len].copy_from_slice(__input);
14603 Bytes::new(&payload_buf)
14604 } else {
14605 Bytes::new(__input)
14606 };
14607 let mut __struct = Self::default();
14608 __struct.time_usec = buf.get_u64_le();
14609 __struct.lat = buf.get_i32_le();
14610 __struct.lon = buf.get_i32_le();
14611 __struct.alt = buf.get_i32_le();
14612 __struct.eph = buf.get_u16_le();
14613 __struct.epv = buf.get_u16_le();
14614 __struct.vel = buf.get_u16_le();
14615 __struct.cog = buf.get_u16_le();
14616 let tmp = buf.get_u8();
14617 __struct.fix_type =
14618 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14619 enum_type: "GpsFixType",
14620 value: tmp as u32,
14621 })?;
14622 __struct.satellites_visible = buf.get_u8();
14623 __struct.alt_ellipsoid = buf.get_i32_le();
14624 __struct.h_acc = buf.get_u32_le();
14625 __struct.v_acc = buf.get_u32_le();
14626 __struct.vel_acc = buf.get_u32_le();
14627 __struct.hdg_acc = buf.get_u32_le();
14628 __struct.yaw = buf.get_u16_le();
14629 Ok(__struct)
14630 }
14631 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14632 let mut __tmp = BytesMut::new(bytes);
14633 #[allow(clippy::absurd_extreme_comparisons)]
14634 #[allow(unused_comparisons)]
14635 if __tmp.remaining() < Self::ENCODED_LEN {
14636 panic!(
14637 "buffer is too small (need {} bytes, but got {})",
14638 Self::ENCODED_LEN,
14639 __tmp.remaining(),
14640 )
14641 }
14642 __tmp.put_u64_le(self.time_usec);
14643 __tmp.put_i32_le(self.lat);
14644 __tmp.put_i32_le(self.lon);
14645 __tmp.put_i32_le(self.alt);
14646 __tmp.put_u16_le(self.eph);
14647 __tmp.put_u16_le(self.epv);
14648 __tmp.put_u16_le(self.vel);
14649 __tmp.put_u16_le(self.cog);
14650 __tmp.put_u8(self.fix_type as u8);
14651 __tmp.put_u8(self.satellites_visible);
14652 if matches!(version, MavlinkVersion::V2) {
14653 __tmp.put_i32_le(self.alt_ellipsoid);
14654 __tmp.put_u32_le(self.h_acc);
14655 __tmp.put_u32_le(self.v_acc);
14656 __tmp.put_u32_le(self.vel_acc);
14657 __tmp.put_u32_le(self.hdg_acc);
14658 __tmp.put_u16_le(self.yaw);
14659 let len = __tmp.len();
14660 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14661 } else {
14662 __tmp.len()
14663 }
14664 }
14665}
14666#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14667#[doc = ""]
14668#[doc = "ID: 233"]
14669#[derive(Debug, Clone, PartialEq)]
14670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14672#[cfg_attr(feature = "ts", derive(TS))]
14673#[cfg_attr(feature = "ts", ts(export))]
14674pub struct GPS_RTCM_DATA_DATA {
14675 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14676 pub flags: u8,
14677 #[doc = "data length"]
14678 pub len: u8,
14679 #[doc = "RTCM message (may be fragmented)"]
14680 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14681 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14682 pub data: [u8; 180],
14683}
14684impl GPS_RTCM_DATA_DATA {
14685 pub const ENCODED_LEN: usize = 182usize;
14686 pub const DEFAULT: Self = Self {
14687 flags: 0_u8,
14688 len: 0_u8,
14689 data: [0_u8; 180usize],
14690 };
14691 #[cfg(feature = "arbitrary")]
14692 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14693 use arbitrary::{Arbitrary, Unstructured};
14694 let mut buf = [0u8; 1024];
14695 rng.fill_bytes(&mut buf);
14696 let mut unstructured = Unstructured::new(&buf);
14697 Self::arbitrary(&mut unstructured).unwrap_or_default()
14698 }
14699}
14700impl Default for GPS_RTCM_DATA_DATA {
14701 fn default() -> Self {
14702 Self::DEFAULT.clone()
14703 }
14704}
14705impl MessageData for GPS_RTCM_DATA_DATA {
14706 type Message = MavMessage;
14707 const ID: u32 = 233u32;
14708 const NAME: &'static str = "GPS_RTCM_DATA";
14709 const EXTRA_CRC: u8 = 35u8;
14710 const ENCODED_LEN: usize = 182usize;
14711 fn deser(
14712 _version: MavlinkVersion,
14713 __input: &[u8],
14714 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14715 let avail_len = __input.len();
14716 let mut payload_buf = [0; Self::ENCODED_LEN];
14717 let mut buf = if avail_len < Self::ENCODED_LEN {
14718 payload_buf[0..avail_len].copy_from_slice(__input);
14719 Bytes::new(&payload_buf)
14720 } else {
14721 Bytes::new(__input)
14722 };
14723 let mut __struct = Self::default();
14724 __struct.flags = buf.get_u8();
14725 __struct.len = buf.get_u8();
14726 for v in &mut __struct.data {
14727 let val = buf.get_u8();
14728 *v = val;
14729 }
14730 Ok(__struct)
14731 }
14732 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14733 let mut __tmp = BytesMut::new(bytes);
14734 #[allow(clippy::absurd_extreme_comparisons)]
14735 #[allow(unused_comparisons)]
14736 if __tmp.remaining() < Self::ENCODED_LEN {
14737 panic!(
14738 "buffer is too small (need {} bytes, but got {})",
14739 Self::ENCODED_LEN,
14740 __tmp.remaining(),
14741 )
14742 }
14743 __tmp.put_u8(self.flags);
14744 __tmp.put_u8(self.len);
14745 for val in &self.data {
14746 __tmp.put_u8(*val);
14747 }
14748 if matches!(version, MavlinkVersion::V2) {
14749 let len = __tmp.len();
14750 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14751 } else {
14752 __tmp.len()
14753 }
14754 }
14755}
14756#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14757#[doc = ""]
14758#[doc = "ID: 127"]
14759#[derive(Debug, Clone, PartialEq)]
14760#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14761#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14762#[cfg_attr(feature = "ts", derive(TS))]
14763#[cfg_attr(feature = "ts", ts(export))]
14764pub struct GPS_RTK_DATA {
14765 #[doc = "Time since boot of last baseline message received."]
14766 pub time_last_baseline_ms: u32,
14767 #[doc = "GPS Time of Week of last baseline"]
14768 pub tow: u32,
14769 #[doc = "Current baseline in ECEF x or NED north component."]
14770 pub baseline_a_mm: i32,
14771 #[doc = "Current baseline in ECEF y or NED east component."]
14772 pub baseline_b_mm: i32,
14773 #[doc = "Current baseline in ECEF z or NED down component."]
14774 pub baseline_c_mm: i32,
14775 #[doc = "Current estimate of baseline accuracy."]
14776 pub accuracy: u32,
14777 #[doc = "Current number of integer ambiguity hypotheses."]
14778 pub iar_num_hypotheses: i32,
14779 #[doc = "GPS Week Number of last baseline"]
14780 pub wn: u16,
14781 #[doc = "Identification of connected RTK receiver."]
14782 pub rtk_receiver_id: u8,
14783 #[doc = "GPS-specific health report for RTK data."]
14784 pub rtk_health: u8,
14785 #[doc = "Rate of baseline messages being received by GPS"]
14786 pub rtk_rate: u8,
14787 #[doc = "Current number of sats used for RTK calculation."]
14788 pub nsats: u8,
14789 #[doc = "Coordinate system of baseline"]
14790 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14791}
14792impl GPS_RTK_DATA {
14793 pub const ENCODED_LEN: usize = 35usize;
14794 pub const DEFAULT: Self = Self {
14795 time_last_baseline_ms: 0_u32,
14796 tow: 0_u32,
14797 baseline_a_mm: 0_i32,
14798 baseline_b_mm: 0_i32,
14799 baseline_c_mm: 0_i32,
14800 accuracy: 0_u32,
14801 iar_num_hypotheses: 0_i32,
14802 wn: 0_u16,
14803 rtk_receiver_id: 0_u8,
14804 rtk_health: 0_u8,
14805 rtk_rate: 0_u8,
14806 nsats: 0_u8,
14807 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14808 };
14809 #[cfg(feature = "arbitrary")]
14810 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14811 use arbitrary::{Arbitrary, Unstructured};
14812 let mut buf = [0u8; 1024];
14813 rng.fill_bytes(&mut buf);
14814 let mut unstructured = Unstructured::new(&buf);
14815 Self::arbitrary(&mut unstructured).unwrap_or_default()
14816 }
14817}
14818impl Default for GPS_RTK_DATA {
14819 fn default() -> Self {
14820 Self::DEFAULT.clone()
14821 }
14822}
14823impl MessageData for GPS_RTK_DATA {
14824 type Message = MavMessage;
14825 const ID: u32 = 127u32;
14826 const NAME: &'static str = "GPS_RTK";
14827 const EXTRA_CRC: u8 = 25u8;
14828 const ENCODED_LEN: usize = 35usize;
14829 fn deser(
14830 _version: MavlinkVersion,
14831 __input: &[u8],
14832 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14833 let avail_len = __input.len();
14834 let mut payload_buf = [0; Self::ENCODED_LEN];
14835 let mut buf = if avail_len < Self::ENCODED_LEN {
14836 payload_buf[0..avail_len].copy_from_slice(__input);
14837 Bytes::new(&payload_buf)
14838 } else {
14839 Bytes::new(__input)
14840 };
14841 let mut __struct = Self::default();
14842 __struct.time_last_baseline_ms = buf.get_u32_le();
14843 __struct.tow = buf.get_u32_le();
14844 __struct.baseline_a_mm = buf.get_i32_le();
14845 __struct.baseline_b_mm = buf.get_i32_le();
14846 __struct.baseline_c_mm = buf.get_i32_le();
14847 __struct.accuracy = buf.get_u32_le();
14848 __struct.iar_num_hypotheses = buf.get_i32_le();
14849 __struct.wn = buf.get_u16_le();
14850 __struct.rtk_receiver_id = buf.get_u8();
14851 __struct.rtk_health = buf.get_u8();
14852 __struct.rtk_rate = buf.get_u8();
14853 __struct.nsats = buf.get_u8();
14854 let tmp = buf.get_u8();
14855 __struct.baseline_coords_type =
14856 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14857 enum_type: "RtkBaselineCoordinateSystem",
14858 value: tmp as u32,
14859 })?;
14860 Ok(__struct)
14861 }
14862 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14863 let mut __tmp = BytesMut::new(bytes);
14864 #[allow(clippy::absurd_extreme_comparisons)]
14865 #[allow(unused_comparisons)]
14866 if __tmp.remaining() < Self::ENCODED_LEN {
14867 panic!(
14868 "buffer is too small (need {} bytes, but got {})",
14869 Self::ENCODED_LEN,
14870 __tmp.remaining(),
14871 )
14872 }
14873 __tmp.put_u32_le(self.time_last_baseline_ms);
14874 __tmp.put_u32_le(self.tow);
14875 __tmp.put_i32_le(self.baseline_a_mm);
14876 __tmp.put_i32_le(self.baseline_b_mm);
14877 __tmp.put_i32_le(self.baseline_c_mm);
14878 __tmp.put_u32_le(self.accuracy);
14879 __tmp.put_i32_le(self.iar_num_hypotheses);
14880 __tmp.put_u16_le(self.wn);
14881 __tmp.put_u8(self.rtk_receiver_id);
14882 __tmp.put_u8(self.rtk_health);
14883 __tmp.put_u8(self.rtk_rate);
14884 __tmp.put_u8(self.nsats);
14885 __tmp.put_u8(self.baseline_coords_type as u8);
14886 if matches!(version, MavlinkVersion::V2) {
14887 let len = __tmp.len();
14888 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14889 } else {
14890 __tmp.len()
14891 }
14892 }
14893}
14894#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14895#[doc = ""]
14896#[doc = "ID: 25"]
14897#[derive(Debug, Clone, PartialEq)]
14898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14900#[cfg_attr(feature = "ts", derive(TS))]
14901#[cfg_attr(feature = "ts", ts(export))]
14902pub struct GPS_STATUS_DATA {
14903 #[doc = "Number of satellites visible"]
14904 pub satellites_visible: u8,
14905 #[doc = "Global satellite ID"]
14906 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14907 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14908 pub satellite_prn: [u8; 20],
14909 #[doc = "0: Satellite not used, 1: used for localization"]
14910 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14911 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14912 pub satellite_used: [u8; 20],
14913 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14915 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14916 pub satellite_elevation: [u8; 20],
14917 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14918 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14919 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14920 pub satellite_azimuth: [u8; 20],
14921 #[doc = "Signal to noise ratio of satellite"]
14922 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14923 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14924 pub satellite_snr: [u8; 20],
14925}
14926impl GPS_STATUS_DATA {
14927 pub const ENCODED_LEN: usize = 101usize;
14928 pub const DEFAULT: Self = Self {
14929 satellites_visible: 0_u8,
14930 satellite_prn: [0_u8; 20usize],
14931 satellite_used: [0_u8; 20usize],
14932 satellite_elevation: [0_u8; 20usize],
14933 satellite_azimuth: [0_u8; 20usize],
14934 satellite_snr: [0_u8; 20usize],
14935 };
14936 #[cfg(feature = "arbitrary")]
14937 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14938 use arbitrary::{Arbitrary, Unstructured};
14939 let mut buf = [0u8; 1024];
14940 rng.fill_bytes(&mut buf);
14941 let mut unstructured = Unstructured::new(&buf);
14942 Self::arbitrary(&mut unstructured).unwrap_or_default()
14943 }
14944}
14945impl Default for GPS_STATUS_DATA {
14946 fn default() -> Self {
14947 Self::DEFAULT.clone()
14948 }
14949}
14950impl MessageData for GPS_STATUS_DATA {
14951 type Message = MavMessage;
14952 const ID: u32 = 25u32;
14953 const NAME: &'static str = "GPS_STATUS";
14954 const EXTRA_CRC: u8 = 23u8;
14955 const ENCODED_LEN: usize = 101usize;
14956 fn deser(
14957 _version: MavlinkVersion,
14958 __input: &[u8],
14959 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14960 let avail_len = __input.len();
14961 let mut payload_buf = [0; Self::ENCODED_LEN];
14962 let mut buf = if avail_len < Self::ENCODED_LEN {
14963 payload_buf[0..avail_len].copy_from_slice(__input);
14964 Bytes::new(&payload_buf)
14965 } else {
14966 Bytes::new(__input)
14967 };
14968 let mut __struct = Self::default();
14969 __struct.satellites_visible = buf.get_u8();
14970 for v in &mut __struct.satellite_prn {
14971 let val = buf.get_u8();
14972 *v = val;
14973 }
14974 for v in &mut __struct.satellite_used {
14975 let val = buf.get_u8();
14976 *v = val;
14977 }
14978 for v in &mut __struct.satellite_elevation {
14979 let val = buf.get_u8();
14980 *v = val;
14981 }
14982 for v in &mut __struct.satellite_azimuth {
14983 let val = buf.get_u8();
14984 *v = val;
14985 }
14986 for v in &mut __struct.satellite_snr {
14987 let val = buf.get_u8();
14988 *v = val;
14989 }
14990 Ok(__struct)
14991 }
14992 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14993 let mut __tmp = BytesMut::new(bytes);
14994 #[allow(clippy::absurd_extreme_comparisons)]
14995 #[allow(unused_comparisons)]
14996 if __tmp.remaining() < Self::ENCODED_LEN {
14997 panic!(
14998 "buffer is too small (need {} bytes, but got {})",
14999 Self::ENCODED_LEN,
15000 __tmp.remaining(),
15001 )
15002 }
15003 __tmp.put_u8(self.satellites_visible);
15004 for val in &self.satellite_prn {
15005 __tmp.put_u8(*val);
15006 }
15007 for val in &self.satellite_used {
15008 __tmp.put_u8(*val);
15009 }
15010 for val in &self.satellite_elevation {
15011 __tmp.put_u8(*val);
15012 }
15013 for val in &self.satellite_azimuth {
15014 __tmp.put_u8(*val);
15015 }
15016 for val in &self.satellite_snr {
15017 __tmp.put_u8(*val);
15018 }
15019 if matches!(version, MavlinkVersion::V2) {
15020 let len = __tmp.len();
15021 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15022 } else {
15023 __tmp.len()
15024 }
15025 }
15026}
15027#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15028#[doc = ""]
15029#[doc = "ID: 0"]
15030#[derive(Debug, Clone, PartialEq)]
15031#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15033#[cfg_attr(feature = "ts", derive(TS))]
15034#[cfg_attr(feature = "ts", ts(export))]
15035pub struct HEARTBEAT_DATA {
15036 #[doc = "A bitfield for use for autopilot-specific flags"]
15037 pub custom_mode: u32,
15038 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15039 pub mavtype: MavType,
15040 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15041 pub autopilot: MavAutopilot,
15042 #[doc = "System mode bitmap."]
15043 pub base_mode: MavModeFlag,
15044 #[doc = "System status flag."]
15045 pub system_status: MavState,
15046 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15047 pub mavlink_version: u8,
15048}
15049impl HEARTBEAT_DATA {
15050 pub const ENCODED_LEN: usize = 9usize;
15051 pub const DEFAULT: Self = Self {
15052 custom_mode: 0_u32,
15053 mavtype: MavType::DEFAULT,
15054 autopilot: MavAutopilot::DEFAULT,
15055 base_mode: MavModeFlag::DEFAULT,
15056 system_status: MavState::DEFAULT,
15057 mavlink_version: MINOR_MAVLINK_VERSION,
15058 };
15059 #[cfg(feature = "arbitrary")]
15060 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15061 use arbitrary::{Arbitrary, Unstructured};
15062 let mut buf = [0u8; 1024];
15063 rng.fill_bytes(&mut buf);
15064 let mut unstructured = Unstructured::new(&buf);
15065 Self::arbitrary(&mut unstructured).unwrap_or_default()
15066 }
15067}
15068impl Default for HEARTBEAT_DATA {
15069 fn default() -> Self {
15070 Self::DEFAULT.clone()
15071 }
15072}
15073impl MessageData for HEARTBEAT_DATA {
15074 type Message = MavMessage;
15075 const ID: u32 = 0u32;
15076 const NAME: &'static str = "HEARTBEAT";
15077 const EXTRA_CRC: u8 = 50u8;
15078 const ENCODED_LEN: usize = 9usize;
15079 fn deser(
15080 _version: MavlinkVersion,
15081 __input: &[u8],
15082 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15083 let avail_len = __input.len();
15084 let mut payload_buf = [0; Self::ENCODED_LEN];
15085 let mut buf = if avail_len < Self::ENCODED_LEN {
15086 payload_buf[0..avail_len].copy_from_slice(__input);
15087 Bytes::new(&payload_buf)
15088 } else {
15089 Bytes::new(__input)
15090 };
15091 let mut __struct = Self::default();
15092 __struct.custom_mode = buf.get_u32_le();
15093 let tmp = buf.get_u8();
15094 __struct.mavtype =
15095 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15096 enum_type: "MavType",
15097 value: tmp as u32,
15098 })?;
15099 let tmp = buf.get_u8();
15100 __struct.autopilot =
15101 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15102 enum_type: "MavAutopilot",
15103 value: tmp as u32,
15104 })?;
15105 let tmp = buf.get_u8();
15106 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15107 ::mavlink_core::error::ParserError::InvalidFlag {
15108 flag_type: "MavModeFlag",
15109 value: tmp as u32,
15110 },
15111 )?;
15112 let tmp = buf.get_u8();
15113 __struct.system_status =
15114 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15115 enum_type: "MavState",
15116 value: tmp as u32,
15117 })?;
15118 __struct.mavlink_version = buf.get_u8();
15119 Ok(__struct)
15120 }
15121 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15122 let mut __tmp = BytesMut::new(bytes);
15123 #[allow(clippy::absurd_extreme_comparisons)]
15124 #[allow(unused_comparisons)]
15125 if __tmp.remaining() < Self::ENCODED_LEN {
15126 panic!(
15127 "buffer is too small (need {} bytes, but got {})",
15128 Self::ENCODED_LEN,
15129 __tmp.remaining(),
15130 )
15131 }
15132 __tmp.put_u32_le(self.custom_mode);
15133 __tmp.put_u8(self.mavtype as u8);
15134 __tmp.put_u8(self.autopilot as u8);
15135 __tmp.put_u8(self.base_mode.bits());
15136 __tmp.put_u8(self.system_status as u8);
15137 __tmp.put_u8(self.mavlink_version);
15138 if matches!(version, MavlinkVersion::V2) {
15139 let len = __tmp.len();
15140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15141 } else {
15142 __tmp.len()
15143 }
15144 }
15145}
15146#[doc = "The IMU readings in SI units in NED body frame."]
15147#[doc = ""]
15148#[doc = "ID: 105"]
15149#[derive(Debug, Clone, PartialEq)]
15150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15152#[cfg_attr(feature = "ts", derive(TS))]
15153#[cfg_attr(feature = "ts", ts(export))]
15154pub struct HIGHRES_IMU_DATA {
15155 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15156 pub time_usec: u64,
15157 #[doc = "X acceleration"]
15158 pub xacc: f32,
15159 #[doc = "Y acceleration"]
15160 pub yacc: f32,
15161 #[doc = "Z acceleration"]
15162 pub zacc: f32,
15163 #[doc = "Angular speed around X axis"]
15164 pub xgyro: f32,
15165 #[doc = "Angular speed around Y axis"]
15166 pub ygyro: f32,
15167 #[doc = "Angular speed around Z axis"]
15168 pub zgyro: f32,
15169 #[doc = "X Magnetic field"]
15170 pub xmag: f32,
15171 #[doc = "Y Magnetic field"]
15172 pub ymag: f32,
15173 #[doc = "Z Magnetic field"]
15174 pub zmag: f32,
15175 #[doc = "Absolute pressure"]
15176 pub abs_pressure: f32,
15177 #[doc = "Differential pressure"]
15178 pub diff_pressure: f32,
15179 #[doc = "Altitude calculated from pressure"]
15180 pub pressure_alt: f32,
15181 #[doc = "Temperature"]
15182 pub temperature: f32,
15183 #[doc = "Bitmap for fields that have updated since last message"]
15184 pub fields_updated: HighresImuUpdatedFlags,
15185 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15186 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15187 pub id: u8,
15188}
15189impl HIGHRES_IMU_DATA {
15190 pub const ENCODED_LEN: usize = 63usize;
15191 pub const DEFAULT: Self = Self {
15192 time_usec: 0_u64,
15193 xacc: 0.0_f32,
15194 yacc: 0.0_f32,
15195 zacc: 0.0_f32,
15196 xgyro: 0.0_f32,
15197 ygyro: 0.0_f32,
15198 zgyro: 0.0_f32,
15199 xmag: 0.0_f32,
15200 ymag: 0.0_f32,
15201 zmag: 0.0_f32,
15202 abs_pressure: 0.0_f32,
15203 diff_pressure: 0.0_f32,
15204 pressure_alt: 0.0_f32,
15205 temperature: 0.0_f32,
15206 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15207 id: 0_u8,
15208 };
15209 #[cfg(feature = "arbitrary")]
15210 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15211 use arbitrary::{Arbitrary, Unstructured};
15212 let mut buf = [0u8; 1024];
15213 rng.fill_bytes(&mut buf);
15214 let mut unstructured = Unstructured::new(&buf);
15215 Self::arbitrary(&mut unstructured).unwrap_or_default()
15216 }
15217}
15218impl Default for HIGHRES_IMU_DATA {
15219 fn default() -> Self {
15220 Self::DEFAULT.clone()
15221 }
15222}
15223impl MessageData for HIGHRES_IMU_DATA {
15224 type Message = MavMessage;
15225 const ID: u32 = 105u32;
15226 const NAME: &'static str = "HIGHRES_IMU";
15227 const EXTRA_CRC: u8 = 93u8;
15228 const ENCODED_LEN: usize = 63usize;
15229 fn deser(
15230 _version: MavlinkVersion,
15231 __input: &[u8],
15232 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15233 let avail_len = __input.len();
15234 let mut payload_buf = [0; Self::ENCODED_LEN];
15235 let mut buf = if avail_len < Self::ENCODED_LEN {
15236 payload_buf[0..avail_len].copy_from_slice(__input);
15237 Bytes::new(&payload_buf)
15238 } else {
15239 Bytes::new(__input)
15240 };
15241 let mut __struct = Self::default();
15242 __struct.time_usec = buf.get_u64_le();
15243 __struct.xacc = buf.get_f32_le();
15244 __struct.yacc = buf.get_f32_le();
15245 __struct.zacc = buf.get_f32_le();
15246 __struct.xgyro = buf.get_f32_le();
15247 __struct.ygyro = buf.get_f32_le();
15248 __struct.zgyro = buf.get_f32_le();
15249 __struct.xmag = buf.get_f32_le();
15250 __struct.ymag = buf.get_f32_le();
15251 __struct.zmag = buf.get_f32_le();
15252 __struct.abs_pressure = buf.get_f32_le();
15253 __struct.diff_pressure = buf.get_f32_le();
15254 __struct.pressure_alt = buf.get_f32_le();
15255 __struct.temperature = buf.get_f32_le();
15256 let tmp = buf.get_u16_le();
15257 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
15258 tmp & HighresImuUpdatedFlags::all().bits(),
15259 )
15260 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15261 flag_type: "HighresImuUpdatedFlags",
15262 value: tmp as u32,
15263 })?;
15264 __struct.id = buf.get_u8();
15265 Ok(__struct)
15266 }
15267 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15268 let mut __tmp = BytesMut::new(bytes);
15269 #[allow(clippy::absurd_extreme_comparisons)]
15270 #[allow(unused_comparisons)]
15271 if __tmp.remaining() < Self::ENCODED_LEN {
15272 panic!(
15273 "buffer is too small (need {} bytes, but got {})",
15274 Self::ENCODED_LEN,
15275 __tmp.remaining(),
15276 )
15277 }
15278 __tmp.put_u64_le(self.time_usec);
15279 __tmp.put_f32_le(self.xacc);
15280 __tmp.put_f32_le(self.yacc);
15281 __tmp.put_f32_le(self.zacc);
15282 __tmp.put_f32_le(self.xgyro);
15283 __tmp.put_f32_le(self.ygyro);
15284 __tmp.put_f32_le(self.zgyro);
15285 __tmp.put_f32_le(self.xmag);
15286 __tmp.put_f32_le(self.ymag);
15287 __tmp.put_f32_le(self.zmag);
15288 __tmp.put_f32_le(self.abs_pressure);
15289 __tmp.put_f32_le(self.diff_pressure);
15290 __tmp.put_f32_le(self.pressure_alt);
15291 __tmp.put_f32_le(self.temperature);
15292 __tmp.put_u16_le(self.fields_updated.bits());
15293 if matches!(version, MavlinkVersion::V2) {
15294 __tmp.put_u8(self.id);
15295 let len = __tmp.len();
15296 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15297 } else {
15298 __tmp.len()
15299 }
15300 }
15301}
15302#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15303#[doc = "Message appropriate for high latency connections like Iridium."]
15304#[doc = ""]
15305#[doc = "ID: 234"]
15306#[derive(Debug, Clone, PartialEq)]
15307#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15308#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15309#[cfg_attr(feature = "ts", derive(TS))]
15310#[cfg_attr(feature = "ts", ts(export))]
15311pub struct HIGH_LATENCY_DATA {
15312 #[doc = "A bitfield for use for autopilot-specific flags."]
15313 pub custom_mode: u32,
15314 #[doc = "Latitude"]
15315 pub latitude: i32,
15316 #[doc = "Longitude"]
15317 pub longitude: i32,
15318 #[doc = "roll"]
15319 pub roll: i16,
15320 #[doc = "pitch"]
15321 pub pitch: i16,
15322 #[doc = "heading"]
15323 pub heading: u16,
15324 #[doc = "heading setpoint"]
15325 pub heading_sp: i16,
15326 #[doc = "Altitude above mean sea level"]
15327 pub altitude_amsl: i16,
15328 #[doc = "Altitude setpoint relative to the home position"]
15329 pub altitude_sp: i16,
15330 #[doc = "distance to target"]
15331 pub wp_distance: u16,
15332 #[doc = "Bitmap of enabled system modes."]
15333 pub base_mode: MavModeFlag,
15334 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15335 pub landed_state: MavLandedState,
15336 #[doc = "throttle (percentage)"]
15337 pub throttle: i8,
15338 #[doc = "airspeed"]
15339 pub airspeed: u8,
15340 #[doc = "airspeed setpoint"]
15341 pub airspeed_sp: u8,
15342 #[doc = "groundspeed"]
15343 pub groundspeed: u8,
15344 #[doc = "climb rate"]
15345 pub climb_rate: i8,
15346 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15347 pub gps_nsat: u8,
15348 #[doc = "GPS Fix type."]
15349 pub gps_fix_type: GpsFixType,
15350 #[doc = "Remaining battery (percentage)"]
15351 pub battery_remaining: u8,
15352 #[doc = "Autopilot temperature (degrees C)"]
15353 pub temperature: i8,
15354 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15355 pub temperature_air: i8,
15356 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15357 pub failsafe: u8,
15358 #[doc = "current waypoint number"]
15359 pub wp_num: u8,
15360}
15361impl HIGH_LATENCY_DATA {
15362 pub const ENCODED_LEN: usize = 40usize;
15363 pub const DEFAULT: Self = Self {
15364 custom_mode: 0_u32,
15365 latitude: 0_i32,
15366 longitude: 0_i32,
15367 roll: 0_i16,
15368 pitch: 0_i16,
15369 heading: 0_u16,
15370 heading_sp: 0_i16,
15371 altitude_amsl: 0_i16,
15372 altitude_sp: 0_i16,
15373 wp_distance: 0_u16,
15374 base_mode: MavModeFlag::DEFAULT,
15375 landed_state: MavLandedState::DEFAULT,
15376 throttle: 0_i8,
15377 airspeed: 0_u8,
15378 airspeed_sp: 0_u8,
15379 groundspeed: 0_u8,
15380 climb_rate: 0_i8,
15381 gps_nsat: 0_u8,
15382 gps_fix_type: GpsFixType::DEFAULT,
15383 battery_remaining: 0_u8,
15384 temperature: 0_i8,
15385 temperature_air: 0_i8,
15386 failsafe: 0_u8,
15387 wp_num: 0_u8,
15388 };
15389 #[cfg(feature = "arbitrary")]
15390 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15391 use arbitrary::{Arbitrary, Unstructured};
15392 let mut buf = [0u8; 1024];
15393 rng.fill_bytes(&mut buf);
15394 let mut unstructured = Unstructured::new(&buf);
15395 Self::arbitrary(&mut unstructured).unwrap_or_default()
15396 }
15397}
15398impl Default for HIGH_LATENCY_DATA {
15399 fn default() -> Self {
15400 Self::DEFAULT.clone()
15401 }
15402}
15403impl MessageData for HIGH_LATENCY_DATA {
15404 type Message = MavMessage;
15405 const ID: u32 = 234u32;
15406 const NAME: &'static str = "HIGH_LATENCY";
15407 const EXTRA_CRC: u8 = 150u8;
15408 const ENCODED_LEN: usize = 40usize;
15409 fn deser(
15410 _version: MavlinkVersion,
15411 __input: &[u8],
15412 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15413 let avail_len = __input.len();
15414 let mut payload_buf = [0; Self::ENCODED_LEN];
15415 let mut buf = if avail_len < Self::ENCODED_LEN {
15416 payload_buf[0..avail_len].copy_from_slice(__input);
15417 Bytes::new(&payload_buf)
15418 } else {
15419 Bytes::new(__input)
15420 };
15421 let mut __struct = Self::default();
15422 __struct.custom_mode = buf.get_u32_le();
15423 __struct.latitude = buf.get_i32_le();
15424 __struct.longitude = buf.get_i32_le();
15425 __struct.roll = buf.get_i16_le();
15426 __struct.pitch = buf.get_i16_le();
15427 __struct.heading = buf.get_u16_le();
15428 __struct.heading_sp = buf.get_i16_le();
15429 __struct.altitude_amsl = buf.get_i16_le();
15430 __struct.altitude_sp = buf.get_i16_le();
15431 __struct.wp_distance = buf.get_u16_le();
15432 let tmp = buf.get_u8();
15433 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15434 ::mavlink_core::error::ParserError::InvalidFlag {
15435 flag_type: "MavModeFlag",
15436 value: tmp as u32,
15437 },
15438 )?;
15439 let tmp = buf.get_u8();
15440 __struct.landed_state =
15441 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15442 enum_type: "MavLandedState",
15443 value: tmp as u32,
15444 })?;
15445 __struct.throttle = buf.get_i8();
15446 __struct.airspeed = buf.get_u8();
15447 __struct.airspeed_sp = buf.get_u8();
15448 __struct.groundspeed = buf.get_u8();
15449 __struct.climb_rate = buf.get_i8();
15450 __struct.gps_nsat = buf.get_u8();
15451 let tmp = buf.get_u8();
15452 __struct.gps_fix_type =
15453 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15454 enum_type: "GpsFixType",
15455 value: tmp as u32,
15456 })?;
15457 __struct.battery_remaining = buf.get_u8();
15458 __struct.temperature = buf.get_i8();
15459 __struct.temperature_air = buf.get_i8();
15460 __struct.failsafe = buf.get_u8();
15461 __struct.wp_num = buf.get_u8();
15462 Ok(__struct)
15463 }
15464 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15465 let mut __tmp = BytesMut::new(bytes);
15466 #[allow(clippy::absurd_extreme_comparisons)]
15467 #[allow(unused_comparisons)]
15468 if __tmp.remaining() < Self::ENCODED_LEN {
15469 panic!(
15470 "buffer is too small (need {} bytes, but got {})",
15471 Self::ENCODED_LEN,
15472 __tmp.remaining(),
15473 )
15474 }
15475 __tmp.put_u32_le(self.custom_mode);
15476 __tmp.put_i32_le(self.latitude);
15477 __tmp.put_i32_le(self.longitude);
15478 __tmp.put_i16_le(self.roll);
15479 __tmp.put_i16_le(self.pitch);
15480 __tmp.put_u16_le(self.heading);
15481 __tmp.put_i16_le(self.heading_sp);
15482 __tmp.put_i16_le(self.altitude_amsl);
15483 __tmp.put_i16_le(self.altitude_sp);
15484 __tmp.put_u16_le(self.wp_distance);
15485 __tmp.put_u8(self.base_mode.bits());
15486 __tmp.put_u8(self.landed_state as u8);
15487 __tmp.put_i8(self.throttle);
15488 __tmp.put_u8(self.airspeed);
15489 __tmp.put_u8(self.airspeed_sp);
15490 __tmp.put_u8(self.groundspeed);
15491 __tmp.put_i8(self.climb_rate);
15492 __tmp.put_u8(self.gps_nsat);
15493 __tmp.put_u8(self.gps_fix_type as u8);
15494 __tmp.put_u8(self.battery_remaining);
15495 __tmp.put_i8(self.temperature);
15496 __tmp.put_i8(self.temperature_air);
15497 __tmp.put_u8(self.failsafe);
15498 __tmp.put_u8(self.wp_num);
15499 if matches!(version, MavlinkVersion::V2) {
15500 let len = __tmp.len();
15501 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15502 } else {
15503 __tmp.len()
15504 }
15505 }
15506}
15507#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15508#[doc = ""]
15509#[doc = "ID: 235"]
15510#[derive(Debug, Clone, PartialEq)]
15511#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15512#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15513#[cfg_attr(feature = "ts", derive(TS))]
15514#[cfg_attr(feature = "ts", ts(export))]
15515pub struct HIGH_LATENCY2_DATA {
15516 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15517 pub timestamp: u32,
15518 #[doc = "Latitude"]
15519 pub latitude: i32,
15520 #[doc = "Longitude"]
15521 pub longitude: i32,
15522 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15523 pub custom_mode: u16,
15524 #[doc = "Altitude above mean sea level"]
15525 pub altitude: i16,
15526 #[doc = "Altitude setpoint"]
15527 pub target_altitude: i16,
15528 #[doc = "Distance to target waypoint or position"]
15529 pub target_distance: u16,
15530 #[doc = "Current waypoint number"]
15531 pub wp_num: u16,
15532 #[doc = "Bitmap of failure flags."]
15533 pub failure_flags: HlFailureFlag,
15534 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15535 pub mavtype: MavType,
15536 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15537 pub autopilot: MavAutopilot,
15538 #[doc = "Heading"]
15539 pub heading: u8,
15540 #[doc = "Heading setpoint"]
15541 pub target_heading: u8,
15542 #[doc = "Throttle"]
15543 pub throttle: u8,
15544 #[doc = "Airspeed"]
15545 pub airspeed: u8,
15546 #[doc = "Airspeed setpoint"]
15547 pub airspeed_sp: u8,
15548 #[doc = "Groundspeed"]
15549 pub groundspeed: u8,
15550 #[doc = "Windspeed"]
15551 pub windspeed: u8,
15552 #[doc = "Wind heading"]
15553 pub wind_heading: u8,
15554 #[doc = "Maximum error horizontal position since last message"]
15555 pub eph: u8,
15556 #[doc = "Maximum error vertical position since last message"]
15557 pub epv: u8,
15558 #[doc = "Air temperature"]
15559 pub temperature_air: i8,
15560 #[doc = "Maximum climb rate magnitude since last message"]
15561 pub climb_rate: i8,
15562 #[doc = "Battery level (-1 if field not provided)."]
15563 pub battery: i8,
15564 #[doc = "Field for custom payload."]
15565 pub custom0: i8,
15566 #[doc = "Field for custom payload."]
15567 pub custom1: i8,
15568 #[doc = "Field for custom payload."]
15569 pub custom2: i8,
15570}
15571impl HIGH_LATENCY2_DATA {
15572 pub const ENCODED_LEN: usize = 42usize;
15573 pub const DEFAULT: Self = Self {
15574 timestamp: 0_u32,
15575 latitude: 0_i32,
15576 longitude: 0_i32,
15577 custom_mode: 0_u16,
15578 altitude: 0_i16,
15579 target_altitude: 0_i16,
15580 target_distance: 0_u16,
15581 wp_num: 0_u16,
15582 failure_flags: HlFailureFlag::DEFAULT,
15583 mavtype: MavType::DEFAULT,
15584 autopilot: MavAutopilot::DEFAULT,
15585 heading: 0_u8,
15586 target_heading: 0_u8,
15587 throttle: 0_u8,
15588 airspeed: 0_u8,
15589 airspeed_sp: 0_u8,
15590 groundspeed: 0_u8,
15591 windspeed: 0_u8,
15592 wind_heading: 0_u8,
15593 eph: 0_u8,
15594 epv: 0_u8,
15595 temperature_air: 0_i8,
15596 climb_rate: 0_i8,
15597 battery: 0_i8,
15598 custom0: 0_i8,
15599 custom1: 0_i8,
15600 custom2: 0_i8,
15601 };
15602 #[cfg(feature = "arbitrary")]
15603 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15604 use arbitrary::{Arbitrary, Unstructured};
15605 let mut buf = [0u8; 1024];
15606 rng.fill_bytes(&mut buf);
15607 let mut unstructured = Unstructured::new(&buf);
15608 Self::arbitrary(&mut unstructured).unwrap_or_default()
15609 }
15610}
15611impl Default for HIGH_LATENCY2_DATA {
15612 fn default() -> Self {
15613 Self::DEFAULT.clone()
15614 }
15615}
15616impl MessageData for HIGH_LATENCY2_DATA {
15617 type Message = MavMessage;
15618 const ID: u32 = 235u32;
15619 const NAME: &'static str = "HIGH_LATENCY2";
15620 const EXTRA_CRC: u8 = 179u8;
15621 const ENCODED_LEN: usize = 42usize;
15622 fn deser(
15623 _version: MavlinkVersion,
15624 __input: &[u8],
15625 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15626 let avail_len = __input.len();
15627 let mut payload_buf = [0; Self::ENCODED_LEN];
15628 let mut buf = if avail_len < Self::ENCODED_LEN {
15629 payload_buf[0..avail_len].copy_from_slice(__input);
15630 Bytes::new(&payload_buf)
15631 } else {
15632 Bytes::new(__input)
15633 };
15634 let mut __struct = Self::default();
15635 __struct.timestamp = buf.get_u32_le();
15636 __struct.latitude = buf.get_i32_le();
15637 __struct.longitude = buf.get_i32_le();
15638 __struct.custom_mode = buf.get_u16_le();
15639 __struct.altitude = buf.get_i16_le();
15640 __struct.target_altitude = buf.get_i16_le();
15641 __struct.target_distance = buf.get_u16_le();
15642 __struct.wp_num = buf.get_u16_le();
15643 let tmp = buf.get_u16_le();
15644 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
15645 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15646 flag_type: "HlFailureFlag",
15647 value: tmp as u32,
15648 })?;
15649 let tmp = buf.get_u8();
15650 __struct.mavtype =
15651 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15652 enum_type: "MavType",
15653 value: tmp as u32,
15654 })?;
15655 let tmp = buf.get_u8();
15656 __struct.autopilot =
15657 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15658 enum_type: "MavAutopilot",
15659 value: tmp as u32,
15660 })?;
15661 __struct.heading = buf.get_u8();
15662 __struct.target_heading = buf.get_u8();
15663 __struct.throttle = buf.get_u8();
15664 __struct.airspeed = buf.get_u8();
15665 __struct.airspeed_sp = buf.get_u8();
15666 __struct.groundspeed = buf.get_u8();
15667 __struct.windspeed = buf.get_u8();
15668 __struct.wind_heading = buf.get_u8();
15669 __struct.eph = buf.get_u8();
15670 __struct.epv = buf.get_u8();
15671 __struct.temperature_air = buf.get_i8();
15672 __struct.climb_rate = buf.get_i8();
15673 __struct.battery = buf.get_i8();
15674 __struct.custom0 = buf.get_i8();
15675 __struct.custom1 = buf.get_i8();
15676 __struct.custom2 = buf.get_i8();
15677 Ok(__struct)
15678 }
15679 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15680 let mut __tmp = BytesMut::new(bytes);
15681 #[allow(clippy::absurd_extreme_comparisons)]
15682 #[allow(unused_comparisons)]
15683 if __tmp.remaining() < Self::ENCODED_LEN {
15684 panic!(
15685 "buffer is too small (need {} bytes, but got {})",
15686 Self::ENCODED_LEN,
15687 __tmp.remaining(),
15688 )
15689 }
15690 __tmp.put_u32_le(self.timestamp);
15691 __tmp.put_i32_le(self.latitude);
15692 __tmp.put_i32_le(self.longitude);
15693 __tmp.put_u16_le(self.custom_mode);
15694 __tmp.put_i16_le(self.altitude);
15695 __tmp.put_i16_le(self.target_altitude);
15696 __tmp.put_u16_le(self.target_distance);
15697 __tmp.put_u16_le(self.wp_num);
15698 __tmp.put_u16_le(self.failure_flags.bits());
15699 __tmp.put_u8(self.mavtype as u8);
15700 __tmp.put_u8(self.autopilot as u8);
15701 __tmp.put_u8(self.heading);
15702 __tmp.put_u8(self.target_heading);
15703 __tmp.put_u8(self.throttle);
15704 __tmp.put_u8(self.airspeed);
15705 __tmp.put_u8(self.airspeed_sp);
15706 __tmp.put_u8(self.groundspeed);
15707 __tmp.put_u8(self.windspeed);
15708 __tmp.put_u8(self.wind_heading);
15709 __tmp.put_u8(self.eph);
15710 __tmp.put_u8(self.epv);
15711 __tmp.put_i8(self.temperature_air);
15712 __tmp.put_i8(self.climb_rate);
15713 __tmp.put_i8(self.battery);
15714 __tmp.put_i8(self.custom0);
15715 __tmp.put_i8(self.custom1);
15716 __tmp.put_i8(self.custom2);
15717 if matches!(version, MavlinkVersion::V2) {
15718 let len = __tmp.len();
15719 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15720 } else {
15721 __tmp.len()
15722 }
15723 }
15724}
15725#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15726#[doc = ""]
15727#[doc = "ID: 93"]
15728#[derive(Debug, Clone, PartialEq)]
15729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15730#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15731#[cfg_attr(feature = "ts", derive(TS))]
15732#[cfg_attr(feature = "ts", ts(export))]
15733pub struct HIL_ACTUATOR_CONTROLS_DATA {
15734 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15735 pub time_usec: u64,
15736 #[doc = "Flags bitmask."]
15737 pub flags: HilActuatorControlsFlags,
15738 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15739 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15740 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15741 pub controls: [f32; 16],
15742 #[doc = "System mode. Includes arming state."]
15743 pub mode: MavModeFlag,
15744}
15745impl HIL_ACTUATOR_CONTROLS_DATA {
15746 pub const ENCODED_LEN: usize = 81usize;
15747 pub const DEFAULT: Self = Self {
15748 time_usec: 0_u64,
15749 flags: HilActuatorControlsFlags::DEFAULT,
15750 controls: [0.0_f32; 16usize],
15751 mode: MavModeFlag::DEFAULT,
15752 };
15753 #[cfg(feature = "arbitrary")]
15754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15755 use arbitrary::{Arbitrary, Unstructured};
15756 let mut buf = [0u8; 1024];
15757 rng.fill_bytes(&mut buf);
15758 let mut unstructured = Unstructured::new(&buf);
15759 Self::arbitrary(&mut unstructured).unwrap_or_default()
15760 }
15761}
15762impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15763 fn default() -> Self {
15764 Self::DEFAULT.clone()
15765 }
15766}
15767impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15768 type Message = MavMessage;
15769 const ID: u32 = 93u32;
15770 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15771 const EXTRA_CRC: u8 = 47u8;
15772 const ENCODED_LEN: usize = 81usize;
15773 fn deser(
15774 _version: MavlinkVersion,
15775 __input: &[u8],
15776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15777 let avail_len = __input.len();
15778 let mut payload_buf = [0; Self::ENCODED_LEN];
15779 let mut buf = if avail_len < Self::ENCODED_LEN {
15780 payload_buf[0..avail_len].copy_from_slice(__input);
15781 Bytes::new(&payload_buf)
15782 } else {
15783 Bytes::new(__input)
15784 };
15785 let mut __struct = Self::default();
15786 __struct.time_usec = buf.get_u64_le();
15787 let tmp = buf.get_u64_le();
15788 __struct.flags =
15789 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
15790 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15791 flag_type: "HilActuatorControlsFlags",
15792 value: tmp as u32,
15793 })?;
15794 for v in &mut __struct.controls {
15795 let val = buf.get_f32_le();
15796 *v = val;
15797 }
15798 let tmp = buf.get_u8();
15799 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15800 ::mavlink_core::error::ParserError::InvalidFlag {
15801 flag_type: "MavModeFlag",
15802 value: tmp as u32,
15803 },
15804 )?;
15805 Ok(__struct)
15806 }
15807 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15808 let mut __tmp = BytesMut::new(bytes);
15809 #[allow(clippy::absurd_extreme_comparisons)]
15810 #[allow(unused_comparisons)]
15811 if __tmp.remaining() < Self::ENCODED_LEN {
15812 panic!(
15813 "buffer is too small (need {} bytes, but got {})",
15814 Self::ENCODED_LEN,
15815 __tmp.remaining(),
15816 )
15817 }
15818 __tmp.put_u64_le(self.time_usec);
15819 __tmp.put_u64_le(self.flags.bits());
15820 for val in &self.controls {
15821 __tmp.put_f32_le(*val);
15822 }
15823 __tmp.put_u8(self.mode.bits());
15824 if matches!(version, MavlinkVersion::V2) {
15825 let len = __tmp.len();
15826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15827 } else {
15828 __tmp.len()
15829 }
15830 }
15831}
15832#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15833#[doc = ""]
15834#[doc = "ID: 91"]
15835#[derive(Debug, Clone, PartialEq)]
15836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15837#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15838#[cfg_attr(feature = "ts", derive(TS))]
15839#[cfg_attr(feature = "ts", ts(export))]
15840pub struct HIL_CONTROLS_DATA {
15841 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15842 pub time_usec: u64,
15843 #[doc = "Control output -1 .. 1"]
15844 pub roll_ailerons: f32,
15845 #[doc = "Control output -1 .. 1"]
15846 pub pitch_elevator: f32,
15847 #[doc = "Control output -1 .. 1"]
15848 pub yaw_rudder: f32,
15849 #[doc = "Throttle 0 .. 1"]
15850 pub throttle: f32,
15851 #[doc = "Aux 1, -1 .. 1"]
15852 pub aux1: f32,
15853 #[doc = "Aux 2, -1 .. 1"]
15854 pub aux2: f32,
15855 #[doc = "Aux 3, -1 .. 1"]
15856 pub aux3: f32,
15857 #[doc = "Aux 4, -1 .. 1"]
15858 pub aux4: f32,
15859 #[doc = "System mode."]
15860 pub mode: MavMode,
15861 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15862 pub nav_mode: u8,
15863}
15864impl HIL_CONTROLS_DATA {
15865 pub const ENCODED_LEN: usize = 42usize;
15866 pub const DEFAULT: Self = Self {
15867 time_usec: 0_u64,
15868 roll_ailerons: 0.0_f32,
15869 pitch_elevator: 0.0_f32,
15870 yaw_rudder: 0.0_f32,
15871 throttle: 0.0_f32,
15872 aux1: 0.0_f32,
15873 aux2: 0.0_f32,
15874 aux3: 0.0_f32,
15875 aux4: 0.0_f32,
15876 mode: MavMode::DEFAULT,
15877 nav_mode: 0_u8,
15878 };
15879 #[cfg(feature = "arbitrary")]
15880 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15881 use arbitrary::{Arbitrary, Unstructured};
15882 let mut buf = [0u8; 1024];
15883 rng.fill_bytes(&mut buf);
15884 let mut unstructured = Unstructured::new(&buf);
15885 Self::arbitrary(&mut unstructured).unwrap_or_default()
15886 }
15887}
15888impl Default for HIL_CONTROLS_DATA {
15889 fn default() -> Self {
15890 Self::DEFAULT.clone()
15891 }
15892}
15893impl MessageData for HIL_CONTROLS_DATA {
15894 type Message = MavMessage;
15895 const ID: u32 = 91u32;
15896 const NAME: &'static str = "HIL_CONTROLS";
15897 const EXTRA_CRC: u8 = 63u8;
15898 const ENCODED_LEN: usize = 42usize;
15899 fn deser(
15900 _version: MavlinkVersion,
15901 __input: &[u8],
15902 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15903 let avail_len = __input.len();
15904 let mut payload_buf = [0; Self::ENCODED_LEN];
15905 let mut buf = if avail_len < Self::ENCODED_LEN {
15906 payload_buf[0..avail_len].copy_from_slice(__input);
15907 Bytes::new(&payload_buf)
15908 } else {
15909 Bytes::new(__input)
15910 };
15911 let mut __struct = Self::default();
15912 __struct.time_usec = buf.get_u64_le();
15913 __struct.roll_ailerons = buf.get_f32_le();
15914 __struct.pitch_elevator = buf.get_f32_le();
15915 __struct.yaw_rudder = buf.get_f32_le();
15916 __struct.throttle = buf.get_f32_le();
15917 __struct.aux1 = buf.get_f32_le();
15918 __struct.aux2 = buf.get_f32_le();
15919 __struct.aux3 = buf.get_f32_le();
15920 __struct.aux4 = buf.get_f32_le();
15921 let tmp = buf.get_u8();
15922 __struct.mode =
15923 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15924 enum_type: "MavMode",
15925 value: tmp as u32,
15926 })?;
15927 __struct.nav_mode = buf.get_u8();
15928 Ok(__struct)
15929 }
15930 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15931 let mut __tmp = BytesMut::new(bytes);
15932 #[allow(clippy::absurd_extreme_comparisons)]
15933 #[allow(unused_comparisons)]
15934 if __tmp.remaining() < Self::ENCODED_LEN {
15935 panic!(
15936 "buffer is too small (need {} bytes, but got {})",
15937 Self::ENCODED_LEN,
15938 __tmp.remaining(),
15939 )
15940 }
15941 __tmp.put_u64_le(self.time_usec);
15942 __tmp.put_f32_le(self.roll_ailerons);
15943 __tmp.put_f32_le(self.pitch_elevator);
15944 __tmp.put_f32_le(self.yaw_rudder);
15945 __tmp.put_f32_le(self.throttle);
15946 __tmp.put_f32_le(self.aux1);
15947 __tmp.put_f32_le(self.aux2);
15948 __tmp.put_f32_le(self.aux3);
15949 __tmp.put_f32_le(self.aux4);
15950 __tmp.put_u8(self.mode as u8);
15951 __tmp.put_u8(self.nav_mode);
15952 if matches!(version, MavlinkVersion::V2) {
15953 let len = __tmp.len();
15954 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15955 } else {
15956 __tmp.len()
15957 }
15958 }
15959}
15960#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15961#[doc = ""]
15962#[doc = "ID: 113"]
15963#[derive(Debug, Clone, PartialEq)]
15964#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15966#[cfg_attr(feature = "ts", derive(TS))]
15967#[cfg_attr(feature = "ts", ts(export))]
15968pub struct HIL_GPS_DATA {
15969 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15970 pub time_usec: u64,
15971 #[doc = "Latitude (WGS84)"]
15972 pub lat: i32,
15973 #[doc = "Longitude (WGS84)"]
15974 pub lon: i32,
15975 #[doc = "Altitude (MSL). Positive for up."]
15976 pub alt: i32,
15977 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15978 pub eph: u16,
15979 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15980 pub epv: u16,
15981 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15982 pub vel: u16,
15983 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15984 pub vn: i16,
15985 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15986 pub ve: i16,
15987 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15988 pub vd: i16,
15989 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15990 pub cog: u16,
15991 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15992 pub fix_type: u8,
15993 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15994 pub satellites_visible: u8,
15995 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15996 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15997 pub id: u8,
15998 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15999 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16000 pub yaw: u16,
16001}
16002impl HIL_GPS_DATA {
16003 pub const ENCODED_LEN: usize = 39usize;
16004 pub const DEFAULT: Self = Self {
16005 time_usec: 0_u64,
16006 lat: 0_i32,
16007 lon: 0_i32,
16008 alt: 0_i32,
16009 eph: 0_u16,
16010 epv: 0_u16,
16011 vel: 0_u16,
16012 vn: 0_i16,
16013 ve: 0_i16,
16014 vd: 0_i16,
16015 cog: 0_u16,
16016 fix_type: 0_u8,
16017 satellites_visible: 0_u8,
16018 id: 0_u8,
16019 yaw: 0_u16,
16020 };
16021 #[cfg(feature = "arbitrary")]
16022 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16023 use arbitrary::{Arbitrary, Unstructured};
16024 let mut buf = [0u8; 1024];
16025 rng.fill_bytes(&mut buf);
16026 let mut unstructured = Unstructured::new(&buf);
16027 Self::arbitrary(&mut unstructured).unwrap_or_default()
16028 }
16029}
16030impl Default for HIL_GPS_DATA {
16031 fn default() -> Self {
16032 Self::DEFAULT.clone()
16033 }
16034}
16035impl MessageData for HIL_GPS_DATA {
16036 type Message = MavMessage;
16037 const ID: u32 = 113u32;
16038 const NAME: &'static str = "HIL_GPS";
16039 const EXTRA_CRC: u8 = 124u8;
16040 const ENCODED_LEN: usize = 39usize;
16041 fn deser(
16042 _version: MavlinkVersion,
16043 __input: &[u8],
16044 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16045 let avail_len = __input.len();
16046 let mut payload_buf = [0; Self::ENCODED_LEN];
16047 let mut buf = if avail_len < Self::ENCODED_LEN {
16048 payload_buf[0..avail_len].copy_from_slice(__input);
16049 Bytes::new(&payload_buf)
16050 } else {
16051 Bytes::new(__input)
16052 };
16053 let mut __struct = Self::default();
16054 __struct.time_usec = buf.get_u64_le();
16055 __struct.lat = buf.get_i32_le();
16056 __struct.lon = buf.get_i32_le();
16057 __struct.alt = buf.get_i32_le();
16058 __struct.eph = buf.get_u16_le();
16059 __struct.epv = buf.get_u16_le();
16060 __struct.vel = buf.get_u16_le();
16061 __struct.vn = buf.get_i16_le();
16062 __struct.ve = buf.get_i16_le();
16063 __struct.vd = buf.get_i16_le();
16064 __struct.cog = buf.get_u16_le();
16065 __struct.fix_type = buf.get_u8();
16066 __struct.satellites_visible = buf.get_u8();
16067 __struct.id = buf.get_u8();
16068 __struct.yaw = buf.get_u16_le();
16069 Ok(__struct)
16070 }
16071 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16072 let mut __tmp = BytesMut::new(bytes);
16073 #[allow(clippy::absurd_extreme_comparisons)]
16074 #[allow(unused_comparisons)]
16075 if __tmp.remaining() < Self::ENCODED_LEN {
16076 panic!(
16077 "buffer is too small (need {} bytes, but got {})",
16078 Self::ENCODED_LEN,
16079 __tmp.remaining(),
16080 )
16081 }
16082 __tmp.put_u64_le(self.time_usec);
16083 __tmp.put_i32_le(self.lat);
16084 __tmp.put_i32_le(self.lon);
16085 __tmp.put_i32_le(self.alt);
16086 __tmp.put_u16_le(self.eph);
16087 __tmp.put_u16_le(self.epv);
16088 __tmp.put_u16_le(self.vel);
16089 __tmp.put_i16_le(self.vn);
16090 __tmp.put_i16_le(self.ve);
16091 __tmp.put_i16_le(self.vd);
16092 __tmp.put_u16_le(self.cog);
16093 __tmp.put_u8(self.fix_type);
16094 __tmp.put_u8(self.satellites_visible);
16095 if matches!(version, MavlinkVersion::V2) {
16096 __tmp.put_u8(self.id);
16097 __tmp.put_u16_le(self.yaw);
16098 let len = __tmp.len();
16099 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16100 } else {
16101 __tmp.len()
16102 }
16103 }
16104}
16105#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16106#[doc = ""]
16107#[doc = "ID: 114"]
16108#[derive(Debug, Clone, PartialEq)]
16109#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16110#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16111#[cfg_attr(feature = "ts", derive(TS))]
16112#[cfg_attr(feature = "ts", ts(export))]
16113pub struct HIL_OPTICAL_FLOW_DATA {
16114 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16115 pub time_usec: u64,
16116 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16117 pub integration_time_us: u32,
16118 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16119 pub integrated_x: f32,
16120 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16121 pub integrated_y: f32,
16122 #[doc = "RH rotation around X axis"]
16123 pub integrated_xgyro: f32,
16124 #[doc = "RH rotation around Y axis"]
16125 pub integrated_ygyro: f32,
16126 #[doc = "RH rotation around Z axis"]
16127 pub integrated_zgyro: f32,
16128 #[doc = "Time since the distance was sampled."]
16129 pub time_delta_distance_us: u32,
16130 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16131 pub distance: f32,
16132 #[doc = "Temperature"]
16133 pub temperature: i16,
16134 #[doc = "Sensor ID"]
16135 pub sensor_id: u8,
16136 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16137 pub quality: u8,
16138}
16139impl HIL_OPTICAL_FLOW_DATA {
16140 pub const ENCODED_LEN: usize = 44usize;
16141 pub const DEFAULT: Self = Self {
16142 time_usec: 0_u64,
16143 integration_time_us: 0_u32,
16144 integrated_x: 0.0_f32,
16145 integrated_y: 0.0_f32,
16146 integrated_xgyro: 0.0_f32,
16147 integrated_ygyro: 0.0_f32,
16148 integrated_zgyro: 0.0_f32,
16149 time_delta_distance_us: 0_u32,
16150 distance: 0.0_f32,
16151 temperature: 0_i16,
16152 sensor_id: 0_u8,
16153 quality: 0_u8,
16154 };
16155 #[cfg(feature = "arbitrary")]
16156 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16157 use arbitrary::{Arbitrary, Unstructured};
16158 let mut buf = [0u8; 1024];
16159 rng.fill_bytes(&mut buf);
16160 let mut unstructured = Unstructured::new(&buf);
16161 Self::arbitrary(&mut unstructured).unwrap_or_default()
16162 }
16163}
16164impl Default for HIL_OPTICAL_FLOW_DATA {
16165 fn default() -> Self {
16166 Self::DEFAULT.clone()
16167 }
16168}
16169impl MessageData for HIL_OPTICAL_FLOW_DATA {
16170 type Message = MavMessage;
16171 const ID: u32 = 114u32;
16172 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16173 const EXTRA_CRC: u8 = 237u8;
16174 const ENCODED_LEN: usize = 44usize;
16175 fn deser(
16176 _version: MavlinkVersion,
16177 __input: &[u8],
16178 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16179 let avail_len = __input.len();
16180 let mut payload_buf = [0; Self::ENCODED_LEN];
16181 let mut buf = if avail_len < Self::ENCODED_LEN {
16182 payload_buf[0..avail_len].copy_from_slice(__input);
16183 Bytes::new(&payload_buf)
16184 } else {
16185 Bytes::new(__input)
16186 };
16187 let mut __struct = Self::default();
16188 __struct.time_usec = buf.get_u64_le();
16189 __struct.integration_time_us = buf.get_u32_le();
16190 __struct.integrated_x = buf.get_f32_le();
16191 __struct.integrated_y = buf.get_f32_le();
16192 __struct.integrated_xgyro = buf.get_f32_le();
16193 __struct.integrated_ygyro = buf.get_f32_le();
16194 __struct.integrated_zgyro = buf.get_f32_le();
16195 __struct.time_delta_distance_us = buf.get_u32_le();
16196 __struct.distance = buf.get_f32_le();
16197 __struct.temperature = buf.get_i16_le();
16198 __struct.sensor_id = buf.get_u8();
16199 __struct.quality = buf.get_u8();
16200 Ok(__struct)
16201 }
16202 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16203 let mut __tmp = BytesMut::new(bytes);
16204 #[allow(clippy::absurd_extreme_comparisons)]
16205 #[allow(unused_comparisons)]
16206 if __tmp.remaining() < Self::ENCODED_LEN {
16207 panic!(
16208 "buffer is too small (need {} bytes, but got {})",
16209 Self::ENCODED_LEN,
16210 __tmp.remaining(),
16211 )
16212 }
16213 __tmp.put_u64_le(self.time_usec);
16214 __tmp.put_u32_le(self.integration_time_us);
16215 __tmp.put_f32_le(self.integrated_x);
16216 __tmp.put_f32_le(self.integrated_y);
16217 __tmp.put_f32_le(self.integrated_xgyro);
16218 __tmp.put_f32_le(self.integrated_ygyro);
16219 __tmp.put_f32_le(self.integrated_zgyro);
16220 __tmp.put_u32_le(self.time_delta_distance_us);
16221 __tmp.put_f32_le(self.distance);
16222 __tmp.put_i16_le(self.temperature);
16223 __tmp.put_u8(self.sensor_id);
16224 __tmp.put_u8(self.quality);
16225 if matches!(version, MavlinkVersion::V2) {
16226 let len = __tmp.len();
16227 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16228 } else {
16229 __tmp.len()
16230 }
16231 }
16232}
16233#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16234#[doc = ""]
16235#[doc = "ID: 92"]
16236#[derive(Debug, Clone, PartialEq)]
16237#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16238#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16239#[cfg_attr(feature = "ts", derive(TS))]
16240#[cfg_attr(feature = "ts", ts(export))]
16241pub struct HIL_RC_INPUTS_RAW_DATA {
16242 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16243 pub time_usec: u64,
16244 #[doc = "RC channel 1 value"]
16245 pub chan1_raw: u16,
16246 #[doc = "RC channel 2 value"]
16247 pub chan2_raw: u16,
16248 #[doc = "RC channel 3 value"]
16249 pub chan3_raw: u16,
16250 #[doc = "RC channel 4 value"]
16251 pub chan4_raw: u16,
16252 #[doc = "RC channel 5 value"]
16253 pub chan5_raw: u16,
16254 #[doc = "RC channel 6 value"]
16255 pub chan6_raw: u16,
16256 #[doc = "RC channel 7 value"]
16257 pub chan7_raw: u16,
16258 #[doc = "RC channel 8 value"]
16259 pub chan8_raw: u16,
16260 #[doc = "RC channel 9 value"]
16261 pub chan9_raw: u16,
16262 #[doc = "RC channel 10 value"]
16263 pub chan10_raw: u16,
16264 #[doc = "RC channel 11 value"]
16265 pub chan11_raw: u16,
16266 #[doc = "RC channel 12 value"]
16267 pub chan12_raw: u16,
16268 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16269 pub rssi: u8,
16270}
16271impl HIL_RC_INPUTS_RAW_DATA {
16272 pub const ENCODED_LEN: usize = 33usize;
16273 pub const DEFAULT: Self = Self {
16274 time_usec: 0_u64,
16275 chan1_raw: 0_u16,
16276 chan2_raw: 0_u16,
16277 chan3_raw: 0_u16,
16278 chan4_raw: 0_u16,
16279 chan5_raw: 0_u16,
16280 chan6_raw: 0_u16,
16281 chan7_raw: 0_u16,
16282 chan8_raw: 0_u16,
16283 chan9_raw: 0_u16,
16284 chan10_raw: 0_u16,
16285 chan11_raw: 0_u16,
16286 chan12_raw: 0_u16,
16287 rssi: 0_u8,
16288 };
16289 #[cfg(feature = "arbitrary")]
16290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16291 use arbitrary::{Arbitrary, Unstructured};
16292 let mut buf = [0u8; 1024];
16293 rng.fill_bytes(&mut buf);
16294 let mut unstructured = Unstructured::new(&buf);
16295 Self::arbitrary(&mut unstructured).unwrap_or_default()
16296 }
16297}
16298impl Default for HIL_RC_INPUTS_RAW_DATA {
16299 fn default() -> Self {
16300 Self::DEFAULT.clone()
16301 }
16302}
16303impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16304 type Message = MavMessage;
16305 const ID: u32 = 92u32;
16306 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16307 const EXTRA_CRC: u8 = 54u8;
16308 const ENCODED_LEN: usize = 33usize;
16309 fn deser(
16310 _version: MavlinkVersion,
16311 __input: &[u8],
16312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16313 let avail_len = __input.len();
16314 let mut payload_buf = [0; Self::ENCODED_LEN];
16315 let mut buf = if avail_len < Self::ENCODED_LEN {
16316 payload_buf[0..avail_len].copy_from_slice(__input);
16317 Bytes::new(&payload_buf)
16318 } else {
16319 Bytes::new(__input)
16320 };
16321 let mut __struct = Self::default();
16322 __struct.time_usec = buf.get_u64_le();
16323 __struct.chan1_raw = buf.get_u16_le();
16324 __struct.chan2_raw = buf.get_u16_le();
16325 __struct.chan3_raw = buf.get_u16_le();
16326 __struct.chan4_raw = buf.get_u16_le();
16327 __struct.chan5_raw = buf.get_u16_le();
16328 __struct.chan6_raw = buf.get_u16_le();
16329 __struct.chan7_raw = buf.get_u16_le();
16330 __struct.chan8_raw = buf.get_u16_le();
16331 __struct.chan9_raw = buf.get_u16_le();
16332 __struct.chan10_raw = buf.get_u16_le();
16333 __struct.chan11_raw = buf.get_u16_le();
16334 __struct.chan12_raw = buf.get_u16_le();
16335 __struct.rssi = buf.get_u8();
16336 Ok(__struct)
16337 }
16338 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16339 let mut __tmp = BytesMut::new(bytes);
16340 #[allow(clippy::absurd_extreme_comparisons)]
16341 #[allow(unused_comparisons)]
16342 if __tmp.remaining() < Self::ENCODED_LEN {
16343 panic!(
16344 "buffer is too small (need {} bytes, but got {})",
16345 Self::ENCODED_LEN,
16346 __tmp.remaining(),
16347 )
16348 }
16349 __tmp.put_u64_le(self.time_usec);
16350 __tmp.put_u16_le(self.chan1_raw);
16351 __tmp.put_u16_le(self.chan2_raw);
16352 __tmp.put_u16_le(self.chan3_raw);
16353 __tmp.put_u16_le(self.chan4_raw);
16354 __tmp.put_u16_le(self.chan5_raw);
16355 __tmp.put_u16_le(self.chan6_raw);
16356 __tmp.put_u16_le(self.chan7_raw);
16357 __tmp.put_u16_le(self.chan8_raw);
16358 __tmp.put_u16_le(self.chan9_raw);
16359 __tmp.put_u16_le(self.chan10_raw);
16360 __tmp.put_u16_le(self.chan11_raw);
16361 __tmp.put_u16_le(self.chan12_raw);
16362 __tmp.put_u8(self.rssi);
16363 if matches!(version, MavlinkVersion::V2) {
16364 let len = __tmp.len();
16365 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16366 } else {
16367 __tmp.len()
16368 }
16369 }
16370}
16371#[doc = "The IMU readings in SI units in NED body frame."]
16372#[doc = ""]
16373#[doc = "ID: 107"]
16374#[derive(Debug, Clone, PartialEq)]
16375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16377#[cfg_attr(feature = "ts", derive(TS))]
16378#[cfg_attr(feature = "ts", ts(export))]
16379pub struct HIL_SENSOR_DATA {
16380 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16381 pub time_usec: u64,
16382 #[doc = "X acceleration"]
16383 pub xacc: f32,
16384 #[doc = "Y acceleration"]
16385 pub yacc: f32,
16386 #[doc = "Z acceleration"]
16387 pub zacc: f32,
16388 #[doc = "Angular speed around X axis in body frame"]
16389 pub xgyro: f32,
16390 #[doc = "Angular speed around Y axis in body frame"]
16391 pub ygyro: f32,
16392 #[doc = "Angular speed around Z axis in body frame"]
16393 pub zgyro: f32,
16394 #[doc = "X Magnetic field"]
16395 pub xmag: f32,
16396 #[doc = "Y Magnetic field"]
16397 pub ymag: f32,
16398 #[doc = "Z Magnetic field"]
16399 pub zmag: f32,
16400 #[doc = "Absolute pressure"]
16401 pub abs_pressure: f32,
16402 #[doc = "Differential pressure (airspeed)"]
16403 pub diff_pressure: f32,
16404 #[doc = "Altitude calculated from pressure"]
16405 pub pressure_alt: f32,
16406 #[doc = "Temperature"]
16407 pub temperature: f32,
16408 #[doc = "Bitmap for fields that have updated since last message"]
16409 pub fields_updated: HilSensorUpdatedFlags,
16410 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16411 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16412 pub id: u8,
16413}
16414impl HIL_SENSOR_DATA {
16415 pub const ENCODED_LEN: usize = 65usize;
16416 pub const DEFAULT: Self = Self {
16417 time_usec: 0_u64,
16418 xacc: 0.0_f32,
16419 yacc: 0.0_f32,
16420 zacc: 0.0_f32,
16421 xgyro: 0.0_f32,
16422 ygyro: 0.0_f32,
16423 zgyro: 0.0_f32,
16424 xmag: 0.0_f32,
16425 ymag: 0.0_f32,
16426 zmag: 0.0_f32,
16427 abs_pressure: 0.0_f32,
16428 diff_pressure: 0.0_f32,
16429 pressure_alt: 0.0_f32,
16430 temperature: 0.0_f32,
16431 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16432 id: 0_u8,
16433 };
16434 #[cfg(feature = "arbitrary")]
16435 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16436 use arbitrary::{Arbitrary, Unstructured};
16437 let mut buf = [0u8; 1024];
16438 rng.fill_bytes(&mut buf);
16439 let mut unstructured = Unstructured::new(&buf);
16440 Self::arbitrary(&mut unstructured).unwrap_or_default()
16441 }
16442}
16443impl Default for HIL_SENSOR_DATA {
16444 fn default() -> Self {
16445 Self::DEFAULT.clone()
16446 }
16447}
16448impl MessageData for HIL_SENSOR_DATA {
16449 type Message = MavMessage;
16450 const ID: u32 = 107u32;
16451 const NAME: &'static str = "HIL_SENSOR";
16452 const EXTRA_CRC: u8 = 108u8;
16453 const ENCODED_LEN: usize = 65usize;
16454 fn deser(
16455 _version: MavlinkVersion,
16456 __input: &[u8],
16457 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16458 let avail_len = __input.len();
16459 let mut payload_buf = [0; Self::ENCODED_LEN];
16460 let mut buf = if avail_len < Self::ENCODED_LEN {
16461 payload_buf[0..avail_len].copy_from_slice(__input);
16462 Bytes::new(&payload_buf)
16463 } else {
16464 Bytes::new(__input)
16465 };
16466 let mut __struct = Self::default();
16467 __struct.time_usec = buf.get_u64_le();
16468 __struct.xacc = buf.get_f32_le();
16469 __struct.yacc = buf.get_f32_le();
16470 __struct.zacc = buf.get_f32_le();
16471 __struct.xgyro = buf.get_f32_le();
16472 __struct.ygyro = buf.get_f32_le();
16473 __struct.zgyro = buf.get_f32_le();
16474 __struct.xmag = buf.get_f32_le();
16475 __struct.ymag = buf.get_f32_le();
16476 __struct.zmag = buf.get_f32_le();
16477 __struct.abs_pressure = buf.get_f32_le();
16478 __struct.diff_pressure = buf.get_f32_le();
16479 __struct.pressure_alt = buf.get_f32_le();
16480 __struct.temperature = buf.get_f32_le();
16481 let tmp = buf.get_u32_le();
16482 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16483 tmp & HilSensorUpdatedFlags::all().bits(),
16484 )
16485 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16486 flag_type: "HilSensorUpdatedFlags",
16487 value: tmp as u32,
16488 })?;
16489 __struct.id = buf.get_u8();
16490 Ok(__struct)
16491 }
16492 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16493 let mut __tmp = BytesMut::new(bytes);
16494 #[allow(clippy::absurd_extreme_comparisons)]
16495 #[allow(unused_comparisons)]
16496 if __tmp.remaining() < Self::ENCODED_LEN {
16497 panic!(
16498 "buffer is too small (need {} bytes, but got {})",
16499 Self::ENCODED_LEN,
16500 __tmp.remaining(),
16501 )
16502 }
16503 __tmp.put_u64_le(self.time_usec);
16504 __tmp.put_f32_le(self.xacc);
16505 __tmp.put_f32_le(self.yacc);
16506 __tmp.put_f32_le(self.zacc);
16507 __tmp.put_f32_le(self.xgyro);
16508 __tmp.put_f32_le(self.ygyro);
16509 __tmp.put_f32_le(self.zgyro);
16510 __tmp.put_f32_le(self.xmag);
16511 __tmp.put_f32_le(self.ymag);
16512 __tmp.put_f32_le(self.zmag);
16513 __tmp.put_f32_le(self.abs_pressure);
16514 __tmp.put_f32_le(self.diff_pressure);
16515 __tmp.put_f32_le(self.pressure_alt);
16516 __tmp.put_f32_le(self.temperature);
16517 __tmp.put_u32_le(self.fields_updated.bits());
16518 if matches!(version, MavlinkVersion::V2) {
16519 __tmp.put_u8(self.id);
16520 let len = __tmp.len();
16521 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16522 } else {
16523 __tmp.len()
16524 }
16525 }
16526}
16527#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16528#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16529#[doc = ""]
16530#[doc = "ID: 90"]
16531#[derive(Debug, Clone, PartialEq)]
16532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16533#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16534#[cfg_attr(feature = "ts", derive(TS))]
16535#[cfg_attr(feature = "ts", ts(export))]
16536pub struct HIL_STATE_DATA {
16537 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16538 pub time_usec: u64,
16539 #[doc = "Roll angle"]
16540 pub roll: f32,
16541 #[doc = "Pitch angle"]
16542 pub pitch: f32,
16543 #[doc = "Yaw angle"]
16544 pub yaw: f32,
16545 #[doc = "Body frame roll / phi angular speed"]
16546 pub rollspeed: f32,
16547 #[doc = "Body frame pitch / theta angular speed"]
16548 pub pitchspeed: f32,
16549 #[doc = "Body frame yaw / psi angular speed"]
16550 pub yawspeed: f32,
16551 #[doc = "Latitude"]
16552 pub lat: i32,
16553 #[doc = "Longitude"]
16554 pub lon: i32,
16555 #[doc = "Altitude"]
16556 pub alt: i32,
16557 #[doc = "Ground X Speed (Latitude)"]
16558 pub vx: i16,
16559 #[doc = "Ground Y Speed (Longitude)"]
16560 pub vy: i16,
16561 #[doc = "Ground Z Speed (Altitude)"]
16562 pub vz: i16,
16563 #[doc = "X acceleration"]
16564 pub xacc: i16,
16565 #[doc = "Y acceleration"]
16566 pub yacc: i16,
16567 #[doc = "Z acceleration"]
16568 pub zacc: i16,
16569}
16570impl HIL_STATE_DATA {
16571 pub const ENCODED_LEN: usize = 56usize;
16572 pub const DEFAULT: Self = Self {
16573 time_usec: 0_u64,
16574 roll: 0.0_f32,
16575 pitch: 0.0_f32,
16576 yaw: 0.0_f32,
16577 rollspeed: 0.0_f32,
16578 pitchspeed: 0.0_f32,
16579 yawspeed: 0.0_f32,
16580 lat: 0_i32,
16581 lon: 0_i32,
16582 alt: 0_i32,
16583 vx: 0_i16,
16584 vy: 0_i16,
16585 vz: 0_i16,
16586 xacc: 0_i16,
16587 yacc: 0_i16,
16588 zacc: 0_i16,
16589 };
16590 #[cfg(feature = "arbitrary")]
16591 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16592 use arbitrary::{Arbitrary, Unstructured};
16593 let mut buf = [0u8; 1024];
16594 rng.fill_bytes(&mut buf);
16595 let mut unstructured = Unstructured::new(&buf);
16596 Self::arbitrary(&mut unstructured).unwrap_or_default()
16597 }
16598}
16599impl Default for HIL_STATE_DATA {
16600 fn default() -> Self {
16601 Self::DEFAULT.clone()
16602 }
16603}
16604impl MessageData for HIL_STATE_DATA {
16605 type Message = MavMessage;
16606 const ID: u32 = 90u32;
16607 const NAME: &'static str = "HIL_STATE";
16608 const EXTRA_CRC: u8 = 183u8;
16609 const ENCODED_LEN: usize = 56usize;
16610 fn deser(
16611 _version: MavlinkVersion,
16612 __input: &[u8],
16613 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16614 let avail_len = __input.len();
16615 let mut payload_buf = [0; Self::ENCODED_LEN];
16616 let mut buf = if avail_len < Self::ENCODED_LEN {
16617 payload_buf[0..avail_len].copy_from_slice(__input);
16618 Bytes::new(&payload_buf)
16619 } else {
16620 Bytes::new(__input)
16621 };
16622 let mut __struct = Self::default();
16623 __struct.time_usec = buf.get_u64_le();
16624 __struct.roll = buf.get_f32_le();
16625 __struct.pitch = buf.get_f32_le();
16626 __struct.yaw = buf.get_f32_le();
16627 __struct.rollspeed = buf.get_f32_le();
16628 __struct.pitchspeed = buf.get_f32_le();
16629 __struct.yawspeed = buf.get_f32_le();
16630 __struct.lat = buf.get_i32_le();
16631 __struct.lon = buf.get_i32_le();
16632 __struct.alt = buf.get_i32_le();
16633 __struct.vx = buf.get_i16_le();
16634 __struct.vy = buf.get_i16_le();
16635 __struct.vz = buf.get_i16_le();
16636 __struct.xacc = buf.get_i16_le();
16637 __struct.yacc = buf.get_i16_le();
16638 __struct.zacc = buf.get_i16_le();
16639 Ok(__struct)
16640 }
16641 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16642 let mut __tmp = BytesMut::new(bytes);
16643 #[allow(clippy::absurd_extreme_comparisons)]
16644 #[allow(unused_comparisons)]
16645 if __tmp.remaining() < Self::ENCODED_LEN {
16646 panic!(
16647 "buffer is too small (need {} bytes, but got {})",
16648 Self::ENCODED_LEN,
16649 __tmp.remaining(),
16650 )
16651 }
16652 __tmp.put_u64_le(self.time_usec);
16653 __tmp.put_f32_le(self.roll);
16654 __tmp.put_f32_le(self.pitch);
16655 __tmp.put_f32_le(self.yaw);
16656 __tmp.put_f32_le(self.rollspeed);
16657 __tmp.put_f32_le(self.pitchspeed);
16658 __tmp.put_f32_le(self.yawspeed);
16659 __tmp.put_i32_le(self.lat);
16660 __tmp.put_i32_le(self.lon);
16661 __tmp.put_i32_le(self.alt);
16662 __tmp.put_i16_le(self.vx);
16663 __tmp.put_i16_le(self.vy);
16664 __tmp.put_i16_le(self.vz);
16665 __tmp.put_i16_le(self.xacc);
16666 __tmp.put_i16_le(self.yacc);
16667 __tmp.put_i16_le(self.zacc);
16668 if matches!(version, MavlinkVersion::V2) {
16669 let len = __tmp.len();
16670 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16671 } else {
16672 __tmp.len()
16673 }
16674 }
16675}
16676#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16677#[doc = ""]
16678#[doc = "ID: 115"]
16679#[derive(Debug, Clone, PartialEq)]
16680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16682#[cfg_attr(feature = "ts", derive(TS))]
16683#[cfg_attr(feature = "ts", ts(export))]
16684pub struct HIL_STATE_QUATERNION_DATA {
16685 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16686 pub time_usec: u64,
16687 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16688 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16689 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16690 pub attitude_quaternion: [f32; 4],
16691 #[doc = "Body frame roll / phi angular speed"]
16692 pub rollspeed: f32,
16693 #[doc = "Body frame pitch / theta angular speed"]
16694 pub pitchspeed: f32,
16695 #[doc = "Body frame yaw / psi angular speed"]
16696 pub yawspeed: f32,
16697 #[doc = "Latitude"]
16698 pub lat: i32,
16699 #[doc = "Longitude"]
16700 pub lon: i32,
16701 #[doc = "Altitude"]
16702 pub alt: i32,
16703 #[doc = "Ground X Speed (Latitude)"]
16704 pub vx: i16,
16705 #[doc = "Ground Y Speed (Longitude)"]
16706 pub vy: i16,
16707 #[doc = "Ground Z Speed (Altitude)"]
16708 pub vz: i16,
16709 #[doc = "Indicated airspeed"]
16710 pub ind_airspeed: u16,
16711 #[doc = "True airspeed"]
16712 pub true_airspeed: u16,
16713 #[doc = "X acceleration"]
16714 pub xacc: i16,
16715 #[doc = "Y acceleration"]
16716 pub yacc: i16,
16717 #[doc = "Z acceleration"]
16718 pub zacc: i16,
16719}
16720impl HIL_STATE_QUATERNION_DATA {
16721 pub const ENCODED_LEN: usize = 64usize;
16722 pub const DEFAULT: Self = Self {
16723 time_usec: 0_u64,
16724 attitude_quaternion: [0.0_f32; 4usize],
16725 rollspeed: 0.0_f32,
16726 pitchspeed: 0.0_f32,
16727 yawspeed: 0.0_f32,
16728 lat: 0_i32,
16729 lon: 0_i32,
16730 alt: 0_i32,
16731 vx: 0_i16,
16732 vy: 0_i16,
16733 vz: 0_i16,
16734 ind_airspeed: 0_u16,
16735 true_airspeed: 0_u16,
16736 xacc: 0_i16,
16737 yacc: 0_i16,
16738 zacc: 0_i16,
16739 };
16740 #[cfg(feature = "arbitrary")]
16741 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16742 use arbitrary::{Arbitrary, Unstructured};
16743 let mut buf = [0u8; 1024];
16744 rng.fill_bytes(&mut buf);
16745 let mut unstructured = Unstructured::new(&buf);
16746 Self::arbitrary(&mut unstructured).unwrap_or_default()
16747 }
16748}
16749impl Default for HIL_STATE_QUATERNION_DATA {
16750 fn default() -> Self {
16751 Self::DEFAULT.clone()
16752 }
16753}
16754impl MessageData for HIL_STATE_QUATERNION_DATA {
16755 type Message = MavMessage;
16756 const ID: u32 = 115u32;
16757 const NAME: &'static str = "HIL_STATE_QUATERNION";
16758 const EXTRA_CRC: u8 = 4u8;
16759 const ENCODED_LEN: usize = 64usize;
16760 fn deser(
16761 _version: MavlinkVersion,
16762 __input: &[u8],
16763 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16764 let avail_len = __input.len();
16765 let mut payload_buf = [0; Self::ENCODED_LEN];
16766 let mut buf = if avail_len < Self::ENCODED_LEN {
16767 payload_buf[0..avail_len].copy_from_slice(__input);
16768 Bytes::new(&payload_buf)
16769 } else {
16770 Bytes::new(__input)
16771 };
16772 let mut __struct = Self::default();
16773 __struct.time_usec = buf.get_u64_le();
16774 for v in &mut __struct.attitude_quaternion {
16775 let val = buf.get_f32_le();
16776 *v = val;
16777 }
16778 __struct.rollspeed = buf.get_f32_le();
16779 __struct.pitchspeed = buf.get_f32_le();
16780 __struct.yawspeed = buf.get_f32_le();
16781 __struct.lat = buf.get_i32_le();
16782 __struct.lon = buf.get_i32_le();
16783 __struct.alt = buf.get_i32_le();
16784 __struct.vx = buf.get_i16_le();
16785 __struct.vy = buf.get_i16_le();
16786 __struct.vz = buf.get_i16_le();
16787 __struct.ind_airspeed = buf.get_u16_le();
16788 __struct.true_airspeed = buf.get_u16_le();
16789 __struct.xacc = buf.get_i16_le();
16790 __struct.yacc = buf.get_i16_le();
16791 __struct.zacc = buf.get_i16_le();
16792 Ok(__struct)
16793 }
16794 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16795 let mut __tmp = BytesMut::new(bytes);
16796 #[allow(clippy::absurd_extreme_comparisons)]
16797 #[allow(unused_comparisons)]
16798 if __tmp.remaining() < Self::ENCODED_LEN {
16799 panic!(
16800 "buffer is too small (need {} bytes, but got {})",
16801 Self::ENCODED_LEN,
16802 __tmp.remaining(),
16803 )
16804 }
16805 __tmp.put_u64_le(self.time_usec);
16806 for val in &self.attitude_quaternion {
16807 __tmp.put_f32_le(*val);
16808 }
16809 __tmp.put_f32_le(self.rollspeed);
16810 __tmp.put_f32_le(self.pitchspeed);
16811 __tmp.put_f32_le(self.yawspeed);
16812 __tmp.put_i32_le(self.lat);
16813 __tmp.put_i32_le(self.lon);
16814 __tmp.put_i32_le(self.alt);
16815 __tmp.put_i16_le(self.vx);
16816 __tmp.put_i16_le(self.vy);
16817 __tmp.put_i16_le(self.vz);
16818 __tmp.put_u16_le(self.ind_airspeed);
16819 __tmp.put_u16_le(self.true_airspeed);
16820 __tmp.put_i16_le(self.xacc);
16821 __tmp.put_i16_le(self.yacc);
16822 __tmp.put_i16_le(self.zacc);
16823 if matches!(version, MavlinkVersion::V2) {
16824 let len = __tmp.len();
16825 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16826 } else {
16827 __tmp.len()
16828 }
16829 }
16830}
16831#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16832#[doc = ""]
16833#[doc = "ID: 242"]
16834#[derive(Debug, Clone, PartialEq)]
16835#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16836#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16837#[cfg_attr(feature = "ts", derive(TS))]
16838#[cfg_attr(feature = "ts", ts(export))]
16839pub struct HOME_POSITION_DATA {
16840 #[doc = "Latitude (WGS84)"]
16841 pub latitude: i32,
16842 #[doc = "Longitude (WGS84)"]
16843 pub longitude: i32,
16844 #[doc = "Altitude (MSL). Positive for up."]
16845 pub altitude: i32,
16846 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16847 pub x: f32,
16848 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16849 pub y: f32,
16850 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16851 pub z: f32,
16852 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16853 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16854 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16855 pub q: [f32; 4],
16856 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16857 pub approach_x: f32,
16858 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16859 pub approach_y: f32,
16860 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16861 pub approach_z: f32,
16862 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16863 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16864 pub time_usec: u64,
16865}
16866impl HOME_POSITION_DATA {
16867 pub const ENCODED_LEN: usize = 60usize;
16868 pub const DEFAULT: Self = Self {
16869 latitude: 0_i32,
16870 longitude: 0_i32,
16871 altitude: 0_i32,
16872 x: 0.0_f32,
16873 y: 0.0_f32,
16874 z: 0.0_f32,
16875 q: [0.0_f32; 4usize],
16876 approach_x: 0.0_f32,
16877 approach_y: 0.0_f32,
16878 approach_z: 0.0_f32,
16879 time_usec: 0_u64,
16880 };
16881 #[cfg(feature = "arbitrary")]
16882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16883 use arbitrary::{Arbitrary, Unstructured};
16884 let mut buf = [0u8; 1024];
16885 rng.fill_bytes(&mut buf);
16886 let mut unstructured = Unstructured::new(&buf);
16887 Self::arbitrary(&mut unstructured).unwrap_or_default()
16888 }
16889}
16890impl Default for HOME_POSITION_DATA {
16891 fn default() -> Self {
16892 Self::DEFAULT.clone()
16893 }
16894}
16895impl MessageData for HOME_POSITION_DATA {
16896 type Message = MavMessage;
16897 const ID: u32 = 242u32;
16898 const NAME: &'static str = "HOME_POSITION";
16899 const EXTRA_CRC: u8 = 104u8;
16900 const ENCODED_LEN: usize = 60usize;
16901 fn deser(
16902 _version: MavlinkVersion,
16903 __input: &[u8],
16904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16905 let avail_len = __input.len();
16906 let mut payload_buf = [0; Self::ENCODED_LEN];
16907 let mut buf = if avail_len < Self::ENCODED_LEN {
16908 payload_buf[0..avail_len].copy_from_slice(__input);
16909 Bytes::new(&payload_buf)
16910 } else {
16911 Bytes::new(__input)
16912 };
16913 let mut __struct = Self::default();
16914 __struct.latitude = buf.get_i32_le();
16915 __struct.longitude = buf.get_i32_le();
16916 __struct.altitude = buf.get_i32_le();
16917 __struct.x = buf.get_f32_le();
16918 __struct.y = buf.get_f32_le();
16919 __struct.z = buf.get_f32_le();
16920 for v in &mut __struct.q {
16921 let val = buf.get_f32_le();
16922 *v = val;
16923 }
16924 __struct.approach_x = buf.get_f32_le();
16925 __struct.approach_y = buf.get_f32_le();
16926 __struct.approach_z = buf.get_f32_le();
16927 __struct.time_usec = buf.get_u64_le();
16928 Ok(__struct)
16929 }
16930 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16931 let mut __tmp = BytesMut::new(bytes);
16932 #[allow(clippy::absurd_extreme_comparisons)]
16933 #[allow(unused_comparisons)]
16934 if __tmp.remaining() < Self::ENCODED_LEN {
16935 panic!(
16936 "buffer is too small (need {} bytes, but got {})",
16937 Self::ENCODED_LEN,
16938 __tmp.remaining(),
16939 )
16940 }
16941 __tmp.put_i32_le(self.latitude);
16942 __tmp.put_i32_le(self.longitude);
16943 __tmp.put_i32_le(self.altitude);
16944 __tmp.put_f32_le(self.x);
16945 __tmp.put_f32_le(self.y);
16946 __tmp.put_f32_le(self.z);
16947 for val in &self.q {
16948 __tmp.put_f32_le(*val);
16949 }
16950 __tmp.put_f32_le(self.approach_x);
16951 __tmp.put_f32_le(self.approach_y);
16952 __tmp.put_f32_le(self.approach_z);
16953 if matches!(version, MavlinkVersion::V2) {
16954 __tmp.put_u64_le(self.time_usec);
16955 let len = __tmp.len();
16956 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16957 } else {
16958 __tmp.len()
16959 }
16960 }
16961}
16962#[doc = "Temperature and humidity from hygrometer."]
16963#[doc = ""]
16964#[doc = "ID: 12920"]
16965#[derive(Debug, Clone, PartialEq)]
16966#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16967#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16968#[cfg_attr(feature = "ts", derive(TS))]
16969#[cfg_attr(feature = "ts", ts(export))]
16970pub struct HYGROMETER_SENSOR_DATA {
16971 #[doc = "Temperature"]
16972 pub temperature: i16,
16973 #[doc = "Humidity"]
16974 pub humidity: u16,
16975 #[doc = "Hygrometer ID"]
16976 pub id: u8,
16977}
16978impl HYGROMETER_SENSOR_DATA {
16979 pub const ENCODED_LEN: usize = 5usize;
16980 pub const DEFAULT: Self = Self {
16981 temperature: 0_i16,
16982 humidity: 0_u16,
16983 id: 0_u8,
16984 };
16985 #[cfg(feature = "arbitrary")]
16986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16987 use arbitrary::{Arbitrary, Unstructured};
16988 let mut buf = [0u8; 1024];
16989 rng.fill_bytes(&mut buf);
16990 let mut unstructured = Unstructured::new(&buf);
16991 Self::arbitrary(&mut unstructured).unwrap_or_default()
16992 }
16993}
16994impl Default for HYGROMETER_SENSOR_DATA {
16995 fn default() -> Self {
16996 Self::DEFAULT.clone()
16997 }
16998}
16999impl MessageData for HYGROMETER_SENSOR_DATA {
17000 type Message = MavMessage;
17001 const ID: u32 = 12920u32;
17002 const NAME: &'static str = "HYGROMETER_SENSOR";
17003 const EXTRA_CRC: u8 = 20u8;
17004 const ENCODED_LEN: usize = 5usize;
17005 fn deser(
17006 _version: MavlinkVersion,
17007 __input: &[u8],
17008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17009 let avail_len = __input.len();
17010 let mut payload_buf = [0; Self::ENCODED_LEN];
17011 let mut buf = if avail_len < Self::ENCODED_LEN {
17012 payload_buf[0..avail_len].copy_from_slice(__input);
17013 Bytes::new(&payload_buf)
17014 } else {
17015 Bytes::new(__input)
17016 };
17017 let mut __struct = Self::default();
17018 __struct.temperature = buf.get_i16_le();
17019 __struct.humidity = buf.get_u16_le();
17020 __struct.id = buf.get_u8();
17021 Ok(__struct)
17022 }
17023 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17024 let mut __tmp = BytesMut::new(bytes);
17025 #[allow(clippy::absurd_extreme_comparisons)]
17026 #[allow(unused_comparisons)]
17027 if __tmp.remaining() < Self::ENCODED_LEN {
17028 panic!(
17029 "buffer is too small (need {} bytes, but got {})",
17030 Self::ENCODED_LEN,
17031 __tmp.remaining(),
17032 )
17033 }
17034 __tmp.put_i16_le(self.temperature);
17035 __tmp.put_u16_le(self.humidity);
17036 __tmp.put_u8(self.id);
17037 if matches!(version, MavlinkVersion::V2) {
17038 let len = __tmp.len();
17039 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17040 } else {
17041 __tmp.len()
17042 }
17043 }
17044}
17045#[doc = "Illuminator status."]
17046#[doc = ""]
17047#[doc = "ID: 440"]
17048#[derive(Debug, Clone, PartialEq)]
17049#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17050#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17051#[cfg_attr(feature = "ts", derive(TS))]
17052#[cfg_attr(feature = "ts", ts(export))]
17053pub struct ILLUMINATOR_STATUS_DATA {
17054 #[doc = "Time since the start-up of the illuminator in ms"]
17055 pub uptime_ms: u32,
17056 #[doc = "Errors"]
17057 pub error_status: IlluminatorErrorFlags,
17058 #[doc = "Illuminator brightness"]
17059 pub brightness: f32,
17060 #[doc = "Illuminator strobing period in seconds"]
17061 pub strobe_period: f32,
17062 #[doc = "Illuminator strobing duty cycle"]
17063 pub strobe_duty_cycle: f32,
17064 #[doc = "Temperature in Celsius"]
17065 pub temp_c: f32,
17066 #[doc = "Minimum strobing period in seconds"]
17067 pub min_strobe_period: f32,
17068 #[doc = "Maximum strobing period in seconds"]
17069 pub max_strobe_period: f32,
17070 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17071 pub enable: u8,
17072 #[doc = "Supported illuminator modes"]
17073 pub mode_bitmask: IlluminatorMode,
17074 #[doc = "Illuminator mode"]
17075 pub mode: IlluminatorMode,
17076}
17077impl ILLUMINATOR_STATUS_DATA {
17078 pub const ENCODED_LEN: usize = 35usize;
17079 pub const DEFAULT: Self = Self {
17080 uptime_ms: 0_u32,
17081 error_status: IlluminatorErrorFlags::DEFAULT,
17082 brightness: 0.0_f32,
17083 strobe_period: 0.0_f32,
17084 strobe_duty_cycle: 0.0_f32,
17085 temp_c: 0.0_f32,
17086 min_strobe_period: 0.0_f32,
17087 max_strobe_period: 0.0_f32,
17088 enable: 0_u8,
17089 mode_bitmask: IlluminatorMode::DEFAULT,
17090 mode: IlluminatorMode::DEFAULT,
17091 };
17092 #[cfg(feature = "arbitrary")]
17093 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17094 use arbitrary::{Arbitrary, Unstructured};
17095 let mut buf = [0u8; 1024];
17096 rng.fill_bytes(&mut buf);
17097 let mut unstructured = Unstructured::new(&buf);
17098 Self::arbitrary(&mut unstructured).unwrap_or_default()
17099 }
17100}
17101impl Default for ILLUMINATOR_STATUS_DATA {
17102 fn default() -> Self {
17103 Self::DEFAULT.clone()
17104 }
17105}
17106impl MessageData for ILLUMINATOR_STATUS_DATA {
17107 type Message = MavMessage;
17108 const ID: u32 = 440u32;
17109 const NAME: &'static str = "ILLUMINATOR_STATUS";
17110 const EXTRA_CRC: u8 = 66u8;
17111 const ENCODED_LEN: usize = 35usize;
17112 fn deser(
17113 _version: MavlinkVersion,
17114 __input: &[u8],
17115 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17116 let avail_len = __input.len();
17117 let mut payload_buf = [0; Self::ENCODED_LEN];
17118 let mut buf = if avail_len < Self::ENCODED_LEN {
17119 payload_buf[0..avail_len].copy_from_slice(__input);
17120 Bytes::new(&payload_buf)
17121 } else {
17122 Bytes::new(__input)
17123 };
17124 let mut __struct = Self::default();
17125 __struct.uptime_ms = buf.get_u32_le();
17126 let tmp = buf.get_u32_le();
17127 __struct.error_status = IlluminatorErrorFlags::from_bits(
17128 tmp & IlluminatorErrorFlags::all().bits(),
17129 )
17130 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17131 flag_type: "IlluminatorErrorFlags",
17132 value: tmp as u32,
17133 })?;
17134 __struct.brightness = buf.get_f32_le();
17135 __struct.strobe_period = buf.get_f32_le();
17136 __struct.strobe_duty_cycle = buf.get_f32_le();
17137 __struct.temp_c = buf.get_f32_le();
17138 __struct.min_strobe_period = buf.get_f32_le();
17139 __struct.max_strobe_period = buf.get_f32_le();
17140 __struct.enable = buf.get_u8();
17141 let tmp = buf.get_u8();
17142 __struct.mode_bitmask =
17143 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17144 enum_type: "IlluminatorMode",
17145 value: tmp as u32,
17146 })?;
17147 let tmp = buf.get_u8();
17148 __struct.mode =
17149 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17150 enum_type: "IlluminatorMode",
17151 value: tmp as u32,
17152 })?;
17153 Ok(__struct)
17154 }
17155 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17156 let mut __tmp = BytesMut::new(bytes);
17157 #[allow(clippy::absurd_extreme_comparisons)]
17158 #[allow(unused_comparisons)]
17159 if __tmp.remaining() < Self::ENCODED_LEN {
17160 panic!(
17161 "buffer is too small (need {} bytes, but got {})",
17162 Self::ENCODED_LEN,
17163 __tmp.remaining(),
17164 )
17165 }
17166 __tmp.put_u32_le(self.uptime_ms);
17167 __tmp.put_u32_le(self.error_status.bits());
17168 __tmp.put_f32_le(self.brightness);
17169 __tmp.put_f32_le(self.strobe_period);
17170 __tmp.put_f32_le(self.strobe_duty_cycle);
17171 __tmp.put_f32_le(self.temp_c);
17172 __tmp.put_f32_le(self.min_strobe_period);
17173 __tmp.put_f32_le(self.max_strobe_period);
17174 __tmp.put_u8(self.enable);
17175 __tmp.put_u8(self.mode_bitmask as u8);
17176 __tmp.put_u8(self.mode as u8);
17177 if matches!(version, MavlinkVersion::V2) {
17178 let len = __tmp.len();
17179 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17180 } else {
17181 __tmp.len()
17182 }
17183 }
17184}
17185#[doc = "Status of the Iridium SBD link."]
17186#[doc = ""]
17187#[doc = "ID: 335"]
17188#[derive(Debug, Clone, PartialEq)]
17189#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17190#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17191#[cfg_attr(feature = "ts", derive(TS))]
17192#[cfg_attr(feature = "ts", ts(export))]
17193pub struct ISBD_LINK_STATUS_DATA {
17194 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17195 pub timestamp: u64,
17196 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17197 pub last_heartbeat: u64,
17198 #[doc = "Number of failed SBD sessions."]
17199 pub failed_sessions: u16,
17200 #[doc = "Number of successful SBD sessions."]
17201 pub successful_sessions: u16,
17202 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17203 pub signal_quality: u8,
17204 #[doc = "1: Ring call pending, 0: No call pending."]
17205 pub ring_pending: u8,
17206 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17207 pub tx_session_pending: u8,
17208 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17209 pub rx_session_pending: u8,
17210}
17211impl ISBD_LINK_STATUS_DATA {
17212 pub const ENCODED_LEN: usize = 24usize;
17213 pub const DEFAULT: Self = Self {
17214 timestamp: 0_u64,
17215 last_heartbeat: 0_u64,
17216 failed_sessions: 0_u16,
17217 successful_sessions: 0_u16,
17218 signal_quality: 0_u8,
17219 ring_pending: 0_u8,
17220 tx_session_pending: 0_u8,
17221 rx_session_pending: 0_u8,
17222 };
17223 #[cfg(feature = "arbitrary")]
17224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17225 use arbitrary::{Arbitrary, Unstructured};
17226 let mut buf = [0u8; 1024];
17227 rng.fill_bytes(&mut buf);
17228 let mut unstructured = Unstructured::new(&buf);
17229 Self::arbitrary(&mut unstructured).unwrap_or_default()
17230 }
17231}
17232impl Default for ISBD_LINK_STATUS_DATA {
17233 fn default() -> Self {
17234 Self::DEFAULT.clone()
17235 }
17236}
17237impl MessageData for ISBD_LINK_STATUS_DATA {
17238 type Message = MavMessage;
17239 const ID: u32 = 335u32;
17240 const NAME: &'static str = "ISBD_LINK_STATUS";
17241 const EXTRA_CRC: u8 = 225u8;
17242 const ENCODED_LEN: usize = 24usize;
17243 fn deser(
17244 _version: MavlinkVersion,
17245 __input: &[u8],
17246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17247 let avail_len = __input.len();
17248 let mut payload_buf = [0; Self::ENCODED_LEN];
17249 let mut buf = if avail_len < Self::ENCODED_LEN {
17250 payload_buf[0..avail_len].copy_from_slice(__input);
17251 Bytes::new(&payload_buf)
17252 } else {
17253 Bytes::new(__input)
17254 };
17255 let mut __struct = Self::default();
17256 __struct.timestamp = buf.get_u64_le();
17257 __struct.last_heartbeat = buf.get_u64_le();
17258 __struct.failed_sessions = buf.get_u16_le();
17259 __struct.successful_sessions = buf.get_u16_le();
17260 __struct.signal_quality = buf.get_u8();
17261 __struct.ring_pending = buf.get_u8();
17262 __struct.tx_session_pending = buf.get_u8();
17263 __struct.rx_session_pending = buf.get_u8();
17264 Ok(__struct)
17265 }
17266 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17267 let mut __tmp = BytesMut::new(bytes);
17268 #[allow(clippy::absurd_extreme_comparisons)]
17269 #[allow(unused_comparisons)]
17270 if __tmp.remaining() < Self::ENCODED_LEN {
17271 panic!(
17272 "buffer is too small (need {} bytes, but got {})",
17273 Self::ENCODED_LEN,
17274 __tmp.remaining(),
17275 )
17276 }
17277 __tmp.put_u64_le(self.timestamp);
17278 __tmp.put_u64_le(self.last_heartbeat);
17279 __tmp.put_u16_le(self.failed_sessions);
17280 __tmp.put_u16_le(self.successful_sessions);
17281 __tmp.put_u8(self.signal_quality);
17282 __tmp.put_u8(self.ring_pending);
17283 __tmp.put_u8(self.tx_session_pending);
17284 __tmp.put_u8(self.rx_session_pending);
17285 if matches!(version, MavlinkVersion::V2) {
17286 let len = __tmp.len();
17287 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17288 } else {
17289 __tmp.len()
17290 }
17291 }
17292}
17293#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17294#[doc = ""]
17295#[doc = "ID: 149"]
17296#[derive(Debug, Clone, PartialEq)]
17297#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17298#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17299#[cfg_attr(feature = "ts", derive(TS))]
17300#[cfg_attr(feature = "ts", ts(export))]
17301pub struct LANDING_TARGET_DATA {
17302 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17303 pub time_usec: u64,
17304 #[doc = "X-axis angular offset of the target from the center of the image"]
17305 pub angle_x: f32,
17306 #[doc = "Y-axis angular offset of the target from the center of the image"]
17307 pub angle_y: f32,
17308 #[doc = "Distance to the target from the vehicle"]
17309 pub distance: f32,
17310 #[doc = "Size of target along x-axis"]
17311 pub size_x: f32,
17312 #[doc = "Size of target along y-axis"]
17313 pub size_y: f32,
17314 #[doc = "The ID of the target if multiple targets are present"]
17315 pub target_num: u8,
17316 #[doc = "Coordinate frame used for following fields."]
17317 pub frame: MavFrame,
17318 #[doc = "X Position of the landing target in MAV_FRAME"]
17319 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17320 pub x: f32,
17321 #[doc = "Y Position of the landing target in MAV_FRAME"]
17322 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17323 pub y: f32,
17324 #[doc = "Z Position of the landing target in MAV_FRAME"]
17325 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17326 pub z: f32,
17327 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17328 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17329 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17330 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17331 pub q: [f32; 4],
17332 #[doc = "Type of landing target"]
17333 #[cfg_attr(feature = "serde", serde(default))]
17334 pub mavtype: LandingTargetType,
17335 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17336 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17337 pub position_valid: u8,
17338}
17339impl LANDING_TARGET_DATA {
17340 pub const ENCODED_LEN: usize = 60usize;
17341 pub const DEFAULT: Self = Self {
17342 time_usec: 0_u64,
17343 angle_x: 0.0_f32,
17344 angle_y: 0.0_f32,
17345 distance: 0.0_f32,
17346 size_x: 0.0_f32,
17347 size_y: 0.0_f32,
17348 target_num: 0_u8,
17349 frame: MavFrame::DEFAULT,
17350 x: 0.0_f32,
17351 y: 0.0_f32,
17352 z: 0.0_f32,
17353 q: [0.0_f32; 4usize],
17354 mavtype: LandingTargetType::DEFAULT,
17355 position_valid: 0_u8,
17356 };
17357 #[cfg(feature = "arbitrary")]
17358 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17359 use arbitrary::{Arbitrary, Unstructured};
17360 let mut buf = [0u8; 1024];
17361 rng.fill_bytes(&mut buf);
17362 let mut unstructured = Unstructured::new(&buf);
17363 Self::arbitrary(&mut unstructured).unwrap_or_default()
17364 }
17365}
17366impl Default for LANDING_TARGET_DATA {
17367 fn default() -> Self {
17368 Self::DEFAULT.clone()
17369 }
17370}
17371impl MessageData for LANDING_TARGET_DATA {
17372 type Message = MavMessage;
17373 const ID: u32 = 149u32;
17374 const NAME: &'static str = "LANDING_TARGET";
17375 const EXTRA_CRC: u8 = 200u8;
17376 const ENCODED_LEN: usize = 60usize;
17377 fn deser(
17378 _version: MavlinkVersion,
17379 __input: &[u8],
17380 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17381 let avail_len = __input.len();
17382 let mut payload_buf = [0; Self::ENCODED_LEN];
17383 let mut buf = if avail_len < Self::ENCODED_LEN {
17384 payload_buf[0..avail_len].copy_from_slice(__input);
17385 Bytes::new(&payload_buf)
17386 } else {
17387 Bytes::new(__input)
17388 };
17389 let mut __struct = Self::default();
17390 __struct.time_usec = buf.get_u64_le();
17391 __struct.angle_x = buf.get_f32_le();
17392 __struct.angle_y = buf.get_f32_le();
17393 __struct.distance = buf.get_f32_le();
17394 __struct.size_x = buf.get_f32_le();
17395 __struct.size_y = buf.get_f32_le();
17396 __struct.target_num = buf.get_u8();
17397 let tmp = buf.get_u8();
17398 __struct.frame =
17399 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17400 enum_type: "MavFrame",
17401 value: tmp as u32,
17402 })?;
17403 __struct.x = buf.get_f32_le();
17404 __struct.y = buf.get_f32_le();
17405 __struct.z = buf.get_f32_le();
17406 for v in &mut __struct.q {
17407 let val = buf.get_f32_le();
17408 *v = val;
17409 }
17410 let tmp = buf.get_u8();
17411 __struct.mavtype =
17412 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17413 enum_type: "LandingTargetType",
17414 value: tmp as u32,
17415 })?;
17416 __struct.position_valid = buf.get_u8();
17417 Ok(__struct)
17418 }
17419 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17420 let mut __tmp = BytesMut::new(bytes);
17421 #[allow(clippy::absurd_extreme_comparisons)]
17422 #[allow(unused_comparisons)]
17423 if __tmp.remaining() < Self::ENCODED_LEN {
17424 panic!(
17425 "buffer is too small (need {} bytes, but got {})",
17426 Self::ENCODED_LEN,
17427 __tmp.remaining(),
17428 )
17429 }
17430 __tmp.put_u64_le(self.time_usec);
17431 __tmp.put_f32_le(self.angle_x);
17432 __tmp.put_f32_le(self.angle_y);
17433 __tmp.put_f32_le(self.distance);
17434 __tmp.put_f32_le(self.size_x);
17435 __tmp.put_f32_le(self.size_y);
17436 __tmp.put_u8(self.target_num);
17437 __tmp.put_u8(self.frame as u8);
17438 if matches!(version, MavlinkVersion::V2) {
17439 __tmp.put_f32_le(self.x);
17440 __tmp.put_f32_le(self.y);
17441 __tmp.put_f32_le(self.z);
17442 for val in &self.q {
17443 __tmp.put_f32_le(*val);
17444 }
17445 __tmp.put_u8(self.mavtype as u8);
17446 __tmp.put_u8(self.position_valid);
17447 let len = __tmp.len();
17448 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17449 } else {
17450 __tmp.len()
17451 }
17452 }
17453}
17454#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17455#[doc = ""]
17456#[doc = "ID: 8"]
17457#[derive(Debug, Clone, PartialEq)]
17458#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17460#[cfg_attr(feature = "ts", derive(TS))]
17461#[cfg_attr(feature = "ts", ts(export))]
17462pub struct LINK_NODE_STATUS_DATA {
17463 #[doc = "Timestamp (time since system boot)."]
17464 pub timestamp: u64,
17465 #[doc = "Transmit rate"]
17466 pub tx_rate: u32,
17467 #[doc = "Receive rate"]
17468 pub rx_rate: u32,
17469 #[doc = "Messages sent"]
17470 pub messages_sent: u32,
17471 #[doc = "Messages received (estimated from counting seq)"]
17472 pub messages_received: u32,
17473 #[doc = "Messages lost (estimated from counting seq)"]
17474 pub messages_lost: u32,
17475 #[doc = "Number of bytes that could not be parsed correctly."]
17476 pub rx_parse_err: u16,
17477 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17478 pub tx_overflows: u16,
17479 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17480 pub rx_overflows: u16,
17481 #[doc = "Remaining free transmit buffer space"]
17482 pub tx_buf: u8,
17483 #[doc = "Remaining free receive buffer space"]
17484 pub rx_buf: u8,
17485}
17486impl LINK_NODE_STATUS_DATA {
17487 pub const ENCODED_LEN: usize = 36usize;
17488 pub const DEFAULT: Self = Self {
17489 timestamp: 0_u64,
17490 tx_rate: 0_u32,
17491 rx_rate: 0_u32,
17492 messages_sent: 0_u32,
17493 messages_received: 0_u32,
17494 messages_lost: 0_u32,
17495 rx_parse_err: 0_u16,
17496 tx_overflows: 0_u16,
17497 rx_overflows: 0_u16,
17498 tx_buf: 0_u8,
17499 rx_buf: 0_u8,
17500 };
17501 #[cfg(feature = "arbitrary")]
17502 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17503 use arbitrary::{Arbitrary, Unstructured};
17504 let mut buf = [0u8; 1024];
17505 rng.fill_bytes(&mut buf);
17506 let mut unstructured = Unstructured::new(&buf);
17507 Self::arbitrary(&mut unstructured).unwrap_or_default()
17508 }
17509}
17510impl Default for LINK_NODE_STATUS_DATA {
17511 fn default() -> Self {
17512 Self::DEFAULT.clone()
17513 }
17514}
17515impl MessageData for LINK_NODE_STATUS_DATA {
17516 type Message = MavMessage;
17517 const ID: u32 = 8u32;
17518 const NAME: &'static str = "LINK_NODE_STATUS";
17519 const EXTRA_CRC: u8 = 117u8;
17520 const ENCODED_LEN: usize = 36usize;
17521 fn deser(
17522 _version: MavlinkVersion,
17523 __input: &[u8],
17524 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17525 let avail_len = __input.len();
17526 let mut payload_buf = [0; Self::ENCODED_LEN];
17527 let mut buf = if avail_len < Self::ENCODED_LEN {
17528 payload_buf[0..avail_len].copy_from_slice(__input);
17529 Bytes::new(&payload_buf)
17530 } else {
17531 Bytes::new(__input)
17532 };
17533 let mut __struct = Self::default();
17534 __struct.timestamp = buf.get_u64_le();
17535 __struct.tx_rate = buf.get_u32_le();
17536 __struct.rx_rate = buf.get_u32_le();
17537 __struct.messages_sent = buf.get_u32_le();
17538 __struct.messages_received = buf.get_u32_le();
17539 __struct.messages_lost = buf.get_u32_le();
17540 __struct.rx_parse_err = buf.get_u16_le();
17541 __struct.tx_overflows = buf.get_u16_le();
17542 __struct.rx_overflows = buf.get_u16_le();
17543 __struct.tx_buf = buf.get_u8();
17544 __struct.rx_buf = buf.get_u8();
17545 Ok(__struct)
17546 }
17547 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17548 let mut __tmp = BytesMut::new(bytes);
17549 #[allow(clippy::absurd_extreme_comparisons)]
17550 #[allow(unused_comparisons)]
17551 if __tmp.remaining() < Self::ENCODED_LEN {
17552 panic!(
17553 "buffer is too small (need {} bytes, but got {})",
17554 Self::ENCODED_LEN,
17555 __tmp.remaining(),
17556 )
17557 }
17558 __tmp.put_u64_le(self.timestamp);
17559 __tmp.put_u32_le(self.tx_rate);
17560 __tmp.put_u32_le(self.rx_rate);
17561 __tmp.put_u32_le(self.messages_sent);
17562 __tmp.put_u32_le(self.messages_received);
17563 __tmp.put_u32_le(self.messages_lost);
17564 __tmp.put_u16_le(self.rx_parse_err);
17565 __tmp.put_u16_le(self.tx_overflows);
17566 __tmp.put_u16_le(self.rx_overflows);
17567 __tmp.put_u8(self.tx_buf);
17568 __tmp.put_u8(self.rx_buf);
17569 if matches!(version, MavlinkVersion::V2) {
17570 let len = __tmp.len();
17571 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17572 } else {
17573 __tmp.len()
17574 }
17575 }
17576}
17577#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17578#[doc = ""]
17579#[doc = "ID: 32"]
17580#[derive(Debug, Clone, PartialEq)]
17581#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17583#[cfg_attr(feature = "ts", derive(TS))]
17584#[cfg_attr(feature = "ts", ts(export))]
17585pub struct LOCAL_POSITION_NED_DATA {
17586 #[doc = "Timestamp (time since system boot)."]
17587 pub time_boot_ms: u32,
17588 #[doc = "X Position"]
17589 pub x: f32,
17590 #[doc = "Y Position"]
17591 pub y: f32,
17592 #[doc = "Z Position"]
17593 pub z: f32,
17594 #[doc = "X Speed"]
17595 pub vx: f32,
17596 #[doc = "Y Speed"]
17597 pub vy: f32,
17598 #[doc = "Z Speed"]
17599 pub vz: f32,
17600}
17601impl LOCAL_POSITION_NED_DATA {
17602 pub const ENCODED_LEN: usize = 28usize;
17603 pub const DEFAULT: Self = Self {
17604 time_boot_ms: 0_u32,
17605 x: 0.0_f32,
17606 y: 0.0_f32,
17607 z: 0.0_f32,
17608 vx: 0.0_f32,
17609 vy: 0.0_f32,
17610 vz: 0.0_f32,
17611 };
17612 #[cfg(feature = "arbitrary")]
17613 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17614 use arbitrary::{Arbitrary, Unstructured};
17615 let mut buf = [0u8; 1024];
17616 rng.fill_bytes(&mut buf);
17617 let mut unstructured = Unstructured::new(&buf);
17618 Self::arbitrary(&mut unstructured).unwrap_or_default()
17619 }
17620}
17621impl Default for LOCAL_POSITION_NED_DATA {
17622 fn default() -> Self {
17623 Self::DEFAULT.clone()
17624 }
17625}
17626impl MessageData for LOCAL_POSITION_NED_DATA {
17627 type Message = MavMessage;
17628 const ID: u32 = 32u32;
17629 const NAME: &'static str = "LOCAL_POSITION_NED";
17630 const EXTRA_CRC: u8 = 185u8;
17631 const ENCODED_LEN: usize = 28usize;
17632 fn deser(
17633 _version: MavlinkVersion,
17634 __input: &[u8],
17635 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17636 let avail_len = __input.len();
17637 let mut payload_buf = [0; Self::ENCODED_LEN];
17638 let mut buf = if avail_len < Self::ENCODED_LEN {
17639 payload_buf[0..avail_len].copy_from_slice(__input);
17640 Bytes::new(&payload_buf)
17641 } else {
17642 Bytes::new(__input)
17643 };
17644 let mut __struct = Self::default();
17645 __struct.time_boot_ms = buf.get_u32_le();
17646 __struct.x = buf.get_f32_le();
17647 __struct.y = buf.get_f32_le();
17648 __struct.z = buf.get_f32_le();
17649 __struct.vx = buf.get_f32_le();
17650 __struct.vy = buf.get_f32_le();
17651 __struct.vz = buf.get_f32_le();
17652 Ok(__struct)
17653 }
17654 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17655 let mut __tmp = BytesMut::new(bytes);
17656 #[allow(clippy::absurd_extreme_comparisons)]
17657 #[allow(unused_comparisons)]
17658 if __tmp.remaining() < Self::ENCODED_LEN {
17659 panic!(
17660 "buffer is too small (need {} bytes, but got {})",
17661 Self::ENCODED_LEN,
17662 __tmp.remaining(),
17663 )
17664 }
17665 __tmp.put_u32_le(self.time_boot_ms);
17666 __tmp.put_f32_le(self.x);
17667 __tmp.put_f32_le(self.y);
17668 __tmp.put_f32_le(self.z);
17669 __tmp.put_f32_le(self.vx);
17670 __tmp.put_f32_le(self.vy);
17671 __tmp.put_f32_le(self.vz);
17672 if matches!(version, MavlinkVersion::V2) {
17673 let len = __tmp.len();
17674 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17675 } else {
17676 __tmp.len()
17677 }
17678 }
17679}
17680#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17681#[doc = ""]
17682#[doc = "ID: 64"]
17683#[derive(Debug, Clone, PartialEq)]
17684#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17685#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17686#[cfg_attr(feature = "ts", derive(TS))]
17687#[cfg_attr(feature = "ts", ts(export))]
17688pub struct LOCAL_POSITION_NED_COV_DATA {
17689 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17690 pub time_usec: u64,
17691 #[doc = "X Position"]
17692 pub x: f32,
17693 #[doc = "Y Position"]
17694 pub y: f32,
17695 #[doc = "Z Position"]
17696 pub z: f32,
17697 #[doc = "X Speed"]
17698 pub vx: f32,
17699 #[doc = "Y Speed"]
17700 pub vy: f32,
17701 #[doc = "Z Speed"]
17702 pub vz: f32,
17703 #[doc = "X Acceleration"]
17704 pub ax: f32,
17705 #[doc = "Y Acceleration"]
17706 pub ay: f32,
17707 #[doc = "Z Acceleration"]
17708 pub az: f32,
17709 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17710 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17711 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17712 pub covariance: [f32; 45],
17713 #[doc = "Class id of the estimator this estimate originated from."]
17714 pub estimator_type: MavEstimatorType,
17715}
17716impl LOCAL_POSITION_NED_COV_DATA {
17717 pub const ENCODED_LEN: usize = 225usize;
17718 pub const DEFAULT: Self = Self {
17719 time_usec: 0_u64,
17720 x: 0.0_f32,
17721 y: 0.0_f32,
17722 z: 0.0_f32,
17723 vx: 0.0_f32,
17724 vy: 0.0_f32,
17725 vz: 0.0_f32,
17726 ax: 0.0_f32,
17727 ay: 0.0_f32,
17728 az: 0.0_f32,
17729 covariance: [0.0_f32; 45usize],
17730 estimator_type: MavEstimatorType::DEFAULT,
17731 };
17732 #[cfg(feature = "arbitrary")]
17733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17734 use arbitrary::{Arbitrary, Unstructured};
17735 let mut buf = [0u8; 1024];
17736 rng.fill_bytes(&mut buf);
17737 let mut unstructured = Unstructured::new(&buf);
17738 Self::arbitrary(&mut unstructured).unwrap_or_default()
17739 }
17740}
17741impl Default for LOCAL_POSITION_NED_COV_DATA {
17742 fn default() -> Self {
17743 Self::DEFAULT.clone()
17744 }
17745}
17746impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17747 type Message = MavMessage;
17748 const ID: u32 = 64u32;
17749 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17750 const EXTRA_CRC: u8 = 191u8;
17751 const ENCODED_LEN: usize = 225usize;
17752 fn deser(
17753 _version: MavlinkVersion,
17754 __input: &[u8],
17755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17756 let avail_len = __input.len();
17757 let mut payload_buf = [0; Self::ENCODED_LEN];
17758 let mut buf = if avail_len < Self::ENCODED_LEN {
17759 payload_buf[0..avail_len].copy_from_slice(__input);
17760 Bytes::new(&payload_buf)
17761 } else {
17762 Bytes::new(__input)
17763 };
17764 let mut __struct = Self::default();
17765 __struct.time_usec = buf.get_u64_le();
17766 __struct.x = buf.get_f32_le();
17767 __struct.y = buf.get_f32_le();
17768 __struct.z = buf.get_f32_le();
17769 __struct.vx = buf.get_f32_le();
17770 __struct.vy = buf.get_f32_le();
17771 __struct.vz = buf.get_f32_le();
17772 __struct.ax = buf.get_f32_le();
17773 __struct.ay = buf.get_f32_le();
17774 __struct.az = buf.get_f32_le();
17775 for v in &mut __struct.covariance {
17776 let val = buf.get_f32_le();
17777 *v = val;
17778 }
17779 let tmp = buf.get_u8();
17780 __struct.estimator_type =
17781 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17782 enum_type: "MavEstimatorType",
17783 value: tmp as u32,
17784 })?;
17785 Ok(__struct)
17786 }
17787 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17788 let mut __tmp = BytesMut::new(bytes);
17789 #[allow(clippy::absurd_extreme_comparisons)]
17790 #[allow(unused_comparisons)]
17791 if __tmp.remaining() < Self::ENCODED_LEN {
17792 panic!(
17793 "buffer is too small (need {} bytes, but got {})",
17794 Self::ENCODED_LEN,
17795 __tmp.remaining(),
17796 )
17797 }
17798 __tmp.put_u64_le(self.time_usec);
17799 __tmp.put_f32_le(self.x);
17800 __tmp.put_f32_le(self.y);
17801 __tmp.put_f32_le(self.z);
17802 __tmp.put_f32_le(self.vx);
17803 __tmp.put_f32_le(self.vy);
17804 __tmp.put_f32_le(self.vz);
17805 __tmp.put_f32_le(self.ax);
17806 __tmp.put_f32_le(self.ay);
17807 __tmp.put_f32_le(self.az);
17808 for val in &self.covariance {
17809 __tmp.put_f32_le(*val);
17810 }
17811 __tmp.put_u8(self.estimator_type as u8);
17812 if matches!(version, MavlinkVersion::V2) {
17813 let len = __tmp.len();
17814 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17815 } else {
17816 __tmp.len()
17817 }
17818 }
17819}
17820#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17821#[doc = ""]
17822#[doc = "ID: 89"]
17823#[derive(Debug, Clone, PartialEq)]
17824#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17825#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17826#[cfg_attr(feature = "ts", derive(TS))]
17827#[cfg_attr(feature = "ts", ts(export))]
17828pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17829 #[doc = "Timestamp (time since system boot)."]
17830 pub time_boot_ms: u32,
17831 #[doc = "X Position"]
17832 pub x: f32,
17833 #[doc = "Y Position"]
17834 pub y: f32,
17835 #[doc = "Z Position"]
17836 pub z: f32,
17837 #[doc = "Roll"]
17838 pub roll: f32,
17839 #[doc = "Pitch"]
17840 pub pitch: f32,
17841 #[doc = "Yaw"]
17842 pub yaw: f32,
17843}
17844impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17845 pub const ENCODED_LEN: usize = 28usize;
17846 pub const DEFAULT: Self = Self {
17847 time_boot_ms: 0_u32,
17848 x: 0.0_f32,
17849 y: 0.0_f32,
17850 z: 0.0_f32,
17851 roll: 0.0_f32,
17852 pitch: 0.0_f32,
17853 yaw: 0.0_f32,
17854 };
17855 #[cfg(feature = "arbitrary")]
17856 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17857 use arbitrary::{Arbitrary, Unstructured};
17858 let mut buf = [0u8; 1024];
17859 rng.fill_bytes(&mut buf);
17860 let mut unstructured = Unstructured::new(&buf);
17861 Self::arbitrary(&mut unstructured).unwrap_or_default()
17862 }
17863}
17864impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17865 fn default() -> Self {
17866 Self::DEFAULT.clone()
17867 }
17868}
17869impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17870 type Message = MavMessage;
17871 const ID: u32 = 89u32;
17872 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17873 const EXTRA_CRC: u8 = 231u8;
17874 const ENCODED_LEN: usize = 28usize;
17875 fn deser(
17876 _version: MavlinkVersion,
17877 __input: &[u8],
17878 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17879 let avail_len = __input.len();
17880 let mut payload_buf = [0; Self::ENCODED_LEN];
17881 let mut buf = if avail_len < Self::ENCODED_LEN {
17882 payload_buf[0..avail_len].copy_from_slice(__input);
17883 Bytes::new(&payload_buf)
17884 } else {
17885 Bytes::new(__input)
17886 };
17887 let mut __struct = Self::default();
17888 __struct.time_boot_ms = buf.get_u32_le();
17889 __struct.x = buf.get_f32_le();
17890 __struct.y = buf.get_f32_le();
17891 __struct.z = buf.get_f32_le();
17892 __struct.roll = buf.get_f32_le();
17893 __struct.pitch = buf.get_f32_le();
17894 __struct.yaw = buf.get_f32_le();
17895 Ok(__struct)
17896 }
17897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17898 let mut __tmp = BytesMut::new(bytes);
17899 #[allow(clippy::absurd_extreme_comparisons)]
17900 #[allow(unused_comparisons)]
17901 if __tmp.remaining() < Self::ENCODED_LEN {
17902 panic!(
17903 "buffer is too small (need {} bytes, but got {})",
17904 Self::ENCODED_LEN,
17905 __tmp.remaining(),
17906 )
17907 }
17908 __tmp.put_u32_le(self.time_boot_ms);
17909 __tmp.put_f32_le(self.x);
17910 __tmp.put_f32_le(self.y);
17911 __tmp.put_f32_le(self.z);
17912 __tmp.put_f32_le(self.roll);
17913 __tmp.put_f32_le(self.pitch);
17914 __tmp.put_f32_le(self.yaw);
17915 if matches!(version, MavlinkVersion::V2) {
17916 let len = __tmp.len();
17917 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17918 } else {
17919 __tmp.len()
17920 }
17921 }
17922}
17923#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17924#[doc = ""]
17925#[doc = "ID: 268"]
17926#[derive(Debug, Clone, PartialEq)]
17927#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17928#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17929#[cfg_attr(feature = "ts", derive(TS))]
17930#[cfg_attr(feature = "ts", ts(export))]
17931pub struct LOGGING_ACK_DATA {
17932 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17933 pub sequence: u16,
17934 #[doc = "system ID of the target"]
17935 pub target_system: u8,
17936 #[doc = "component ID of the target"]
17937 pub target_component: u8,
17938}
17939impl LOGGING_ACK_DATA {
17940 pub const ENCODED_LEN: usize = 4usize;
17941 pub const DEFAULT: Self = Self {
17942 sequence: 0_u16,
17943 target_system: 0_u8,
17944 target_component: 0_u8,
17945 };
17946 #[cfg(feature = "arbitrary")]
17947 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17948 use arbitrary::{Arbitrary, Unstructured};
17949 let mut buf = [0u8; 1024];
17950 rng.fill_bytes(&mut buf);
17951 let mut unstructured = Unstructured::new(&buf);
17952 Self::arbitrary(&mut unstructured).unwrap_or_default()
17953 }
17954}
17955impl Default for LOGGING_ACK_DATA {
17956 fn default() -> Self {
17957 Self::DEFAULT.clone()
17958 }
17959}
17960impl MessageData for LOGGING_ACK_DATA {
17961 type Message = MavMessage;
17962 const ID: u32 = 268u32;
17963 const NAME: &'static str = "LOGGING_ACK";
17964 const EXTRA_CRC: u8 = 14u8;
17965 const ENCODED_LEN: usize = 4usize;
17966 fn deser(
17967 _version: MavlinkVersion,
17968 __input: &[u8],
17969 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17970 let avail_len = __input.len();
17971 let mut payload_buf = [0; Self::ENCODED_LEN];
17972 let mut buf = if avail_len < Self::ENCODED_LEN {
17973 payload_buf[0..avail_len].copy_from_slice(__input);
17974 Bytes::new(&payload_buf)
17975 } else {
17976 Bytes::new(__input)
17977 };
17978 let mut __struct = Self::default();
17979 __struct.sequence = buf.get_u16_le();
17980 __struct.target_system = buf.get_u8();
17981 __struct.target_component = buf.get_u8();
17982 Ok(__struct)
17983 }
17984 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17985 let mut __tmp = BytesMut::new(bytes);
17986 #[allow(clippy::absurd_extreme_comparisons)]
17987 #[allow(unused_comparisons)]
17988 if __tmp.remaining() < Self::ENCODED_LEN {
17989 panic!(
17990 "buffer is too small (need {} bytes, but got {})",
17991 Self::ENCODED_LEN,
17992 __tmp.remaining(),
17993 )
17994 }
17995 __tmp.put_u16_le(self.sequence);
17996 __tmp.put_u8(self.target_system);
17997 __tmp.put_u8(self.target_component);
17998 if matches!(version, MavlinkVersion::V2) {
17999 let len = __tmp.len();
18000 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18001 } else {
18002 __tmp.len()
18003 }
18004 }
18005}
18006#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18007#[doc = ""]
18008#[doc = "ID: 266"]
18009#[derive(Debug, Clone, PartialEq)]
18010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18012#[cfg_attr(feature = "ts", derive(TS))]
18013#[cfg_attr(feature = "ts", ts(export))]
18014pub struct LOGGING_DATA_DATA {
18015 #[doc = "sequence number (can wrap)"]
18016 pub sequence: u16,
18017 #[doc = "system ID of the target"]
18018 pub target_system: u8,
18019 #[doc = "component ID of the target"]
18020 pub target_component: u8,
18021 #[doc = "data length"]
18022 pub length: u8,
18023 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18024 pub first_message_offset: u8,
18025 #[doc = "logged data"]
18026 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18027 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18028 pub data: [u8; 249],
18029}
18030impl LOGGING_DATA_DATA {
18031 pub const ENCODED_LEN: usize = 255usize;
18032 pub const DEFAULT: Self = Self {
18033 sequence: 0_u16,
18034 target_system: 0_u8,
18035 target_component: 0_u8,
18036 length: 0_u8,
18037 first_message_offset: 0_u8,
18038 data: [0_u8; 249usize],
18039 };
18040 #[cfg(feature = "arbitrary")]
18041 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18042 use arbitrary::{Arbitrary, Unstructured};
18043 let mut buf = [0u8; 1024];
18044 rng.fill_bytes(&mut buf);
18045 let mut unstructured = Unstructured::new(&buf);
18046 Self::arbitrary(&mut unstructured).unwrap_or_default()
18047 }
18048}
18049impl Default for LOGGING_DATA_DATA {
18050 fn default() -> Self {
18051 Self::DEFAULT.clone()
18052 }
18053}
18054impl MessageData for LOGGING_DATA_DATA {
18055 type Message = MavMessage;
18056 const ID: u32 = 266u32;
18057 const NAME: &'static str = "LOGGING_DATA";
18058 const EXTRA_CRC: u8 = 193u8;
18059 const ENCODED_LEN: usize = 255usize;
18060 fn deser(
18061 _version: MavlinkVersion,
18062 __input: &[u8],
18063 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18064 let avail_len = __input.len();
18065 let mut payload_buf = [0; Self::ENCODED_LEN];
18066 let mut buf = if avail_len < Self::ENCODED_LEN {
18067 payload_buf[0..avail_len].copy_from_slice(__input);
18068 Bytes::new(&payload_buf)
18069 } else {
18070 Bytes::new(__input)
18071 };
18072 let mut __struct = Self::default();
18073 __struct.sequence = buf.get_u16_le();
18074 __struct.target_system = buf.get_u8();
18075 __struct.target_component = buf.get_u8();
18076 __struct.length = buf.get_u8();
18077 __struct.first_message_offset = buf.get_u8();
18078 for v in &mut __struct.data {
18079 let val = buf.get_u8();
18080 *v = val;
18081 }
18082 Ok(__struct)
18083 }
18084 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18085 let mut __tmp = BytesMut::new(bytes);
18086 #[allow(clippy::absurd_extreme_comparisons)]
18087 #[allow(unused_comparisons)]
18088 if __tmp.remaining() < Self::ENCODED_LEN {
18089 panic!(
18090 "buffer is too small (need {} bytes, but got {})",
18091 Self::ENCODED_LEN,
18092 __tmp.remaining(),
18093 )
18094 }
18095 __tmp.put_u16_le(self.sequence);
18096 __tmp.put_u8(self.target_system);
18097 __tmp.put_u8(self.target_component);
18098 __tmp.put_u8(self.length);
18099 __tmp.put_u8(self.first_message_offset);
18100 for val in &self.data {
18101 __tmp.put_u8(*val);
18102 }
18103 if matches!(version, MavlinkVersion::V2) {
18104 let len = __tmp.len();
18105 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18106 } else {
18107 __tmp.len()
18108 }
18109 }
18110}
18111#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18112#[doc = ""]
18113#[doc = "ID: 267"]
18114#[derive(Debug, Clone, PartialEq)]
18115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18117#[cfg_attr(feature = "ts", derive(TS))]
18118#[cfg_attr(feature = "ts", ts(export))]
18119pub struct LOGGING_DATA_ACKED_DATA {
18120 #[doc = "sequence number (can wrap)"]
18121 pub sequence: u16,
18122 #[doc = "system ID of the target"]
18123 pub target_system: u8,
18124 #[doc = "component ID of the target"]
18125 pub target_component: u8,
18126 #[doc = "data length"]
18127 pub length: u8,
18128 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18129 pub first_message_offset: u8,
18130 #[doc = "logged data"]
18131 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18132 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18133 pub data: [u8; 249],
18134}
18135impl LOGGING_DATA_ACKED_DATA {
18136 pub const ENCODED_LEN: usize = 255usize;
18137 pub const DEFAULT: Self = Self {
18138 sequence: 0_u16,
18139 target_system: 0_u8,
18140 target_component: 0_u8,
18141 length: 0_u8,
18142 first_message_offset: 0_u8,
18143 data: [0_u8; 249usize],
18144 };
18145 #[cfg(feature = "arbitrary")]
18146 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18147 use arbitrary::{Arbitrary, Unstructured};
18148 let mut buf = [0u8; 1024];
18149 rng.fill_bytes(&mut buf);
18150 let mut unstructured = Unstructured::new(&buf);
18151 Self::arbitrary(&mut unstructured).unwrap_or_default()
18152 }
18153}
18154impl Default for LOGGING_DATA_ACKED_DATA {
18155 fn default() -> Self {
18156 Self::DEFAULT.clone()
18157 }
18158}
18159impl MessageData for LOGGING_DATA_ACKED_DATA {
18160 type Message = MavMessage;
18161 const ID: u32 = 267u32;
18162 const NAME: &'static str = "LOGGING_DATA_ACKED";
18163 const EXTRA_CRC: u8 = 35u8;
18164 const ENCODED_LEN: usize = 255usize;
18165 fn deser(
18166 _version: MavlinkVersion,
18167 __input: &[u8],
18168 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18169 let avail_len = __input.len();
18170 let mut payload_buf = [0; Self::ENCODED_LEN];
18171 let mut buf = if avail_len < Self::ENCODED_LEN {
18172 payload_buf[0..avail_len].copy_from_slice(__input);
18173 Bytes::new(&payload_buf)
18174 } else {
18175 Bytes::new(__input)
18176 };
18177 let mut __struct = Self::default();
18178 __struct.sequence = buf.get_u16_le();
18179 __struct.target_system = buf.get_u8();
18180 __struct.target_component = buf.get_u8();
18181 __struct.length = buf.get_u8();
18182 __struct.first_message_offset = buf.get_u8();
18183 for v in &mut __struct.data {
18184 let val = buf.get_u8();
18185 *v = val;
18186 }
18187 Ok(__struct)
18188 }
18189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18190 let mut __tmp = BytesMut::new(bytes);
18191 #[allow(clippy::absurd_extreme_comparisons)]
18192 #[allow(unused_comparisons)]
18193 if __tmp.remaining() < Self::ENCODED_LEN {
18194 panic!(
18195 "buffer is too small (need {} bytes, but got {})",
18196 Self::ENCODED_LEN,
18197 __tmp.remaining(),
18198 )
18199 }
18200 __tmp.put_u16_le(self.sequence);
18201 __tmp.put_u8(self.target_system);
18202 __tmp.put_u8(self.target_component);
18203 __tmp.put_u8(self.length);
18204 __tmp.put_u8(self.first_message_offset);
18205 for val in &self.data {
18206 __tmp.put_u8(*val);
18207 }
18208 if matches!(version, MavlinkVersion::V2) {
18209 let len = __tmp.len();
18210 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18211 } else {
18212 __tmp.len()
18213 }
18214 }
18215}
18216#[doc = "Reply to LOG_REQUEST_DATA."]
18217#[doc = ""]
18218#[doc = "ID: 120"]
18219#[derive(Debug, Clone, PartialEq)]
18220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18221#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18222#[cfg_attr(feature = "ts", derive(TS))]
18223#[cfg_attr(feature = "ts", ts(export))]
18224pub struct LOG_DATA_DATA {
18225 #[doc = "Offset into the log"]
18226 pub ofs: u32,
18227 #[doc = "Log id (from LOG_ENTRY reply)"]
18228 pub id: u16,
18229 #[doc = "Number of bytes (zero for end of log)"]
18230 pub count: u8,
18231 #[doc = "log data"]
18232 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18233 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18234 pub data: [u8; 90],
18235}
18236impl LOG_DATA_DATA {
18237 pub const ENCODED_LEN: usize = 97usize;
18238 pub const DEFAULT: Self = Self {
18239 ofs: 0_u32,
18240 id: 0_u16,
18241 count: 0_u8,
18242 data: [0_u8; 90usize],
18243 };
18244 #[cfg(feature = "arbitrary")]
18245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18246 use arbitrary::{Arbitrary, Unstructured};
18247 let mut buf = [0u8; 1024];
18248 rng.fill_bytes(&mut buf);
18249 let mut unstructured = Unstructured::new(&buf);
18250 Self::arbitrary(&mut unstructured).unwrap_or_default()
18251 }
18252}
18253impl Default for LOG_DATA_DATA {
18254 fn default() -> Self {
18255 Self::DEFAULT.clone()
18256 }
18257}
18258impl MessageData for LOG_DATA_DATA {
18259 type Message = MavMessage;
18260 const ID: u32 = 120u32;
18261 const NAME: &'static str = "LOG_DATA";
18262 const EXTRA_CRC: u8 = 134u8;
18263 const ENCODED_LEN: usize = 97usize;
18264 fn deser(
18265 _version: MavlinkVersion,
18266 __input: &[u8],
18267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18268 let avail_len = __input.len();
18269 let mut payload_buf = [0; Self::ENCODED_LEN];
18270 let mut buf = if avail_len < Self::ENCODED_LEN {
18271 payload_buf[0..avail_len].copy_from_slice(__input);
18272 Bytes::new(&payload_buf)
18273 } else {
18274 Bytes::new(__input)
18275 };
18276 let mut __struct = Self::default();
18277 __struct.ofs = buf.get_u32_le();
18278 __struct.id = buf.get_u16_le();
18279 __struct.count = buf.get_u8();
18280 for v in &mut __struct.data {
18281 let val = buf.get_u8();
18282 *v = val;
18283 }
18284 Ok(__struct)
18285 }
18286 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18287 let mut __tmp = BytesMut::new(bytes);
18288 #[allow(clippy::absurd_extreme_comparisons)]
18289 #[allow(unused_comparisons)]
18290 if __tmp.remaining() < Self::ENCODED_LEN {
18291 panic!(
18292 "buffer is too small (need {} bytes, but got {})",
18293 Self::ENCODED_LEN,
18294 __tmp.remaining(),
18295 )
18296 }
18297 __tmp.put_u32_le(self.ofs);
18298 __tmp.put_u16_le(self.id);
18299 __tmp.put_u8(self.count);
18300 for val in &self.data {
18301 __tmp.put_u8(*val);
18302 }
18303 if matches!(version, MavlinkVersion::V2) {
18304 let len = __tmp.len();
18305 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18306 } else {
18307 __tmp.len()
18308 }
18309 }
18310}
18311#[doc = "Reply to LOG_REQUEST_LIST."]
18312#[doc = ""]
18313#[doc = "ID: 118"]
18314#[derive(Debug, Clone, PartialEq)]
18315#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18316#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18317#[cfg_attr(feature = "ts", derive(TS))]
18318#[cfg_attr(feature = "ts", ts(export))]
18319pub struct LOG_ENTRY_DATA {
18320 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18321 pub time_utc: u32,
18322 #[doc = "Size of the log (may be approximate)"]
18323 pub size: u32,
18324 #[doc = "Log id"]
18325 pub id: u16,
18326 #[doc = "Total number of logs"]
18327 pub num_logs: u16,
18328 #[doc = "High log number"]
18329 pub last_log_num: u16,
18330}
18331impl LOG_ENTRY_DATA {
18332 pub const ENCODED_LEN: usize = 14usize;
18333 pub const DEFAULT: Self = Self {
18334 time_utc: 0_u32,
18335 size: 0_u32,
18336 id: 0_u16,
18337 num_logs: 0_u16,
18338 last_log_num: 0_u16,
18339 };
18340 #[cfg(feature = "arbitrary")]
18341 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18342 use arbitrary::{Arbitrary, Unstructured};
18343 let mut buf = [0u8; 1024];
18344 rng.fill_bytes(&mut buf);
18345 let mut unstructured = Unstructured::new(&buf);
18346 Self::arbitrary(&mut unstructured).unwrap_or_default()
18347 }
18348}
18349impl Default for LOG_ENTRY_DATA {
18350 fn default() -> Self {
18351 Self::DEFAULT.clone()
18352 }
18353}
18354impl MessageData for LOG_ENTRY_DATA {
18355 type Message = MavMessage;
18356 const ID: u32 = 118u32;
18357 const NAME: &'static str = "LOG_ENTRY";
18358 const EXTRA_CRC: u8 = 56u8;
18359 const ENCODED_LEN: usize = 14usize;
18360 fn deser(
18361 _version: MavlinkVersion,
18362 __input: &[u8],
18363 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18364 let avail_len = __input.len();
18365 let mut payload_buf = [0; Self::ENCODED_LEN];
18366 let mut buf = if avail_len < Self::ENCODED_LEN {
18367 payload_buf[0..avail_len].copy_from_slice(__input);
18368 Bytes::new(&payload_buf)
18369 } else {
18370 Bytes::new(__input)
18371 };
18372 let mut __struct = Self::default();
18373 __struct.time_utc = buf.get_u32_le();
18374 __struct.size = buf.get_u32_le();
18375 __struct.id = buf.get_u16_le();
18376 __struct.num_logs = buf.get_u16_le();
18377 __struct.last_log_num = buf.get_u16_le();
18378 Ok(__struct)
18379 }
18380 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18381 let mut __tmp = BytesMut::new(bytes);
18382 #[allow(clippy::absurd_extreme_comparisons)]
18383 #[allow(unused_comparisons)]
18384 if __tmp.remaining() < Self::ENCODED_LEN {
18385 panic!(
18386 "buffer is too small (need {} bytes, but got {})",
18387 Self::ENCODED_LEN,
18388 __tmp.remaining(),
18389 )
18390 }
18391 __tmp.put_u32_le(self.time_utc);
18392 __tmp.put_u32_le(self.size);
18393 __tmp.put_u16_le(self.id);
18394 __tmp.put_u16_le(self.num_logs);
18395 __tmp.put_u16_le(self.last_log_num);
18396 if matches!(version, MavlinkVersion::V2) {
18397 let len = __tmp.len();
18398 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18399 } else {
18400 __tmp.len()
18401 }
18402 }
18403}
18404#[doc = "Erase all logs."]
18405#[doc = ""]
18406#[doc = "ID: 121"]
18407#[derive(Debug, Clone, PartialEq)]
18408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18410#[cfg_attr(feature = "ts", derive(TS))]
18411#[cfg_attr(feature = "ts", ts(export))]
18412pub struct LOG_ERASE_DATA {
18413 #[doc = "System ID"]
18414 pub target_system: u8,
18415 #[doc = "Component ID"]
18416 pub target_component: u8,
18417}
18418impl LOG_ERASE_DATA {
18419 pub const ENCODED_LEN: usize = 2usize;
18420 pub const DEFAULT: Self = Self {
18421 target_system: 0_u8,
18422 target_component: 0_u8,
18423 };
18424 #[cfg(feature = "arbitrary")]
18425 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18426 use arbitrary::{Arbitrary, Unstructured};
18427 let mut buf = [0u8; 1024];
18428 rng.fill_bytes(&mut buf);
18429 let mut unstructured = Unstructured::new(&buf);
18430 Self::arbitrary(&mut unstructured).unwrap_or_default()
18431 }
18432}
18433impl Default for LOG_ERASE_DATA {
18434 fn default() -> Self {
18435 Self::DEFAULT.clone()
18436 }
18437}
18438impl MessageData for LOG_ERASE_DATA {
18439 type Message = MavMessage;
18440 const ID: u32 = 121u32;
18441 const NAME: &'static str = "LOG_ERASE";
18442 const EXTRA_CRC: u8 = 237u8;
18443 const ENCODED_LEN: usize = 2usize;
18444 fn deser(
18445 _version: MavlinkVersion,
18446 __input: &[u8],
18447 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18448 let avail_len = __input.len();
18449 let mut payload_buf = [0; Self::ENCODED_LEN];
18450 let mut buf = if avail_len < Self::ENCODED_LEN {
18451 payload_buf[0..avail_len].copy_from_slice(__input);
18452 Bytes::new(&payload_buf)
18453 } else {
18454 Bytes::new(__input)
18455 };
18456 let mut __struct = Self::default();
18457 __struct.target_system = buf.get_u8();
18458 __struct.target_component = buf.get_u8();
18459 Ok(__struct)
18460 }
18461 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18462 let mut __tmp = BytesMut::new(bytes);
18463 #[allow(clippy::absurd_extreme_comparisons)]
18464 #[allow(unused_comparisons)]
18465 if __tmp.remaining() < Self::ENCODED_LEN {
18466 panic!(
18467 "buffer is too small (need {} bytes, but got {})",
18468 Self::ENCODED_LEN,
18469 __tmp.remaining(),
18470 )
18471 }
18472 __tmp.put_u8(self.target_system);
18473 __tmp.put_u8(self.target_component);
18474 if matches!(version, MavlinkVersion::V2) {
18475 let len = __tmp.len();
18476 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18477 } else {
18478 __tmp.len()
18479 }
18480 }
18481}
18482#[doc = "Request a chunk of a log."]
18483#[doc = ""]
18484#[doc = "ID: 119"]
18485#[derive(Debug, Clone, PartialEq)]
18486#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18487#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18488#[cfg_attr(feature = "ts", derive(TS))]
18489#[cfg_attr(feature = "ts", ts(export))]
18490pub struct LOG_REQUEST_DATA_DATA {
18491 #[doc = "Offset into the log"]
18492 pub ofs: u32,
18493 #[doc = "Number of bytes"]
18494 pub count: u32,
18495 #[doc = "Log id (from LOG_ENTRY reply)"]
18496 pub id: u16,
18497 #[doc = "System ID"]
18498 pub target_system: u8,
18499 #[doc = "Component ID"]
18500 pub target_component: u8,
18501}
18502impl LOG_REQUEST_DATA_DATA {
18503 pub const ENCODED_LEN: usize = 12usize;
18504 pub const DEFAULT: Self = Self {
18505 ofs: 0_u32,
18506 count: 0_u32,
18507 id: 0_u16,
18508 target_system: 0_u8,
18509 target_component: 0_u8,
18510 };
18511 #[cfg(feature = "arbitrary")]
18512 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18513 use arbitrary::{Arbitrary, Unstructured};
18514 let mut buf = [0u8; 1024];
18515 rng.fill_bytes(&mut buf);
18516 let mut unstructured = Unstructured::new(&buf);
18517 Self::arbitrary(&mut unstructured).unwrap_or_default()
18518 }
18519}
18520impl Default for LOG_REQUEST_DATA_DATA {
18521 fn default() -> Self {
18522 Self::DEFAULT.clone()
18523 }
18524}
18525impl MessageData for LOG_REQUEST_DATA_DATA {
18526 type Message = MavMessage;
18527 const ID: u32 = 119u32;
18528 const NAME: &'static str = "LOG_REQUEST_DATA";
18529 const EXTRA_CRC: u8 = 116u8;
18530 const ENCODED_LEN: usize = 12usize;
18531 fn deser(
18532 _version: MavlinkVersion,
18533 __input: &[u8],
18534 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18535 let avail_len = __input.len();
18536 let mut payload_buf = [0; Self::ENCODED_LEN];
18537 let mut buf = if avail_len < Self::ENCODED_LEN {
18538 payload_buf[0..avail_len].copy_from_slice(__input);
18539 Bytes::new(&payload_buf)
18540 } else {
18541 Bytes::new(__input)
18542 };
18543 let mut __struct = Self::default();
18544 __struct.ofs = buf.get_u32_le();
18545 __struct.count = buf.get_u32_le();
18546 __struct.id = buf.get_u16_le();
18547 __struct.target_system = buf.get_u8();
18548 __struct.target_component = buf.get_u8();
18549 Ok(__struct)
18550 }
18551 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18552 let mut __tmp = BytesMut::new(bytes);
18553 #[allow(clippy::absurd_extreme_comparisons)]
18554 #[allow(unused_comparisons)]
18555 if __tmp.remaining() < Self::ENCODED_LEN {
18556 panic!(
18557 "buffer is too small (need {} bytes, but got {})",
18558 Self::ENCODED_LEN,
18559 __tmp.remaining(),
18560 )
18561 }
18562 __tmp.put_u32_le(self.ofs);
18563 __tmp.put_u32_le(self.count);
18564 __tmp.put_u16_le(self.id);
18565 __tmp.put_u8(self.target_system);
18566 __tmp.put_u8(self.target_component);
18567 if matches!(version, MavlinkVersion::V2) {
18568 let len = __tmp.len();
18569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18570 } else {
18571 __tmp.len()
18572 }
18573 }
18574}
18575#[doc = "Stop log transfer and resume normal logging."]
18576#[doc = ""]
18577#[doc = "ID: 122"]
18578#[derive(Debug, Clone, PartialEq)]
18579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18581#[cfg_attr(feature = "ts", derive(TS))]
18582#[cfg_attr(feature = "ts", ts(export))]
18583pub struct LOG_REQUEST_END_DATA {
18584 #[doc = "System ID"]
18585 pub target_system: u8,
18586 #[doc = "Component ID"]
18587 pub target_component: u8,
18588}
18589impl LOG_REQUEST_END_DATA {
18590 pub const ENCODED_LEN: usize = 2usize;
18591 pub const DEFAULT: Self = Self {
18592 target_system: 0_u8,
18593 target_component: 0_u8,
18594 };
18595 #[cfg(feature = "arbitrary")]
18596 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18597 use arbitrary::{Arbitrary, Unstructured};
18598 let mut buf = [0u8; 1024];
18599 rng.fill_bytes(&mut buf);
18600 let mut unstructured = Unstructured::new(&buf);
18601 Self::arbitrary(&mut unstructured).unwrap_or_default()
18602 }
18603}
18604impl Default for LOG_REQUEST_END_DATA {
18605 fn default() -> Self {
18606 Self::DEFAULT.clone()
18607 }
18608}
18609impl MessageData for LOG_REQUEST_END_DATA {
18610 type Message = MavMessage;
18611 const ID: u32 = 122u32;
18612 const NAME: &'static str = "LOG_REQUEST_END";
18613 const EXTRA_CRC: u8 = 203u8;
18614 const ENCODED_LEN: usize = 2usize;
18615 fn deser(
18616 _version: MavlinkVersion,
18617 __input: &[u8],
18618 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18619 let avail_len = __input.len();
18620 let mut payload_buf = [0; Self::ENCODED_LEN];
18621 let mut buf = if avail_len < Self::ENCODED_LEN {
18622 payload_buf[0..avail_len].copy_from_slice(__input);
18623 Bytes::new(&payload_buf)
18624 } else {
18625 Bytes::new(__input)
18626 };
18627 let mut __struct = Self::default();
18628 __struct.target_system = buf.get_u8();
18629 __struct.target_component = buf.get_u8();
18630 Ok(__struct)
18631 }
18632 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18633 let mut __tmp = BytesMut::new(bytes);
18634 #[allow(clippy::absurd_extreme_comparisons)]
18635 #[allow(unused_comparisons)]
18636 if __tmp.remaining() < Self::ENCODED_LEN {
18637 panic!(
18638 "buffer is too small (need {} bytes, but got {})",
18639 Self::ENCODED_LEN,
18640 __tmp.remaining(),
18641 )
18642 }
18643 __tmp.put_u8(self.target_system);
18644 __tmp.put_u8(self.target_component);
18645 if matches!(version, MavlinkVersion::V2) {
18646 let len = __tmp.len();
18647 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18648 } else {
18649 __tmp.len()
18650 }
18651 }
18652}
18653#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18654#[doc = ""]
18655#[doc = "ID: 117"]
18656#[derive(Debug, Clone, PartialEq)]
18657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18659#[cfg_attr(feature = "ts", derive(TS))]
18660#[cfg_attr(feature = "ts", ts(export))]
18661pub struct LOG_REQUEST_LIST_DATA {
18662 #[doc = "First log id (0 for first available)"]
18663 pub start: u16,
18664 #[doc = "Last log id (0xffff for last available)"]
18665 pub end: u16,
18666 #[doc = "System ID"]
18667 pub target_system: u8,
18668 #[doc = "Component ID"]
18669 pub target_component: u8,
18670}
18671impl LOG_REQUEST_LIST_DATA {
18672 pub const ENCODED_LEN: usize = 6usize;
18673 pub const DEFAULT: Self = Self {
18674 start: 0_u16,
18675 end: 0_u16,
18676 target_system: 0_u8,
18677 target_component: 0_u8,
18678 };
18679 #[cfg(feature = "arbitrary")]
18680 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18681 use arbitrary::{Arbitrary, Unstructured};
18682 let mut buf = [0u8; 1024];
18683 rng.fill_bytes(&mut buf);
18684 let mut unstructured = Unstructured::new(&buf);
18685 Self::arbitrary(&mut unstructured).unwrap_or_default()
18686 }
18687}
18688impl Default for LOG_REQUEST_LIST_DATA {
18689 fn default() -> Self {
18690 Self::DEFAULT.clone()
18691 }
18692}
18693impl MessageData for LOG_REQUEST_LIST_DATA {
18694 type Message = MavMessage;
18695 const ID: u32 = 117u32;
18696 const NAME: &'static str = "LOG_REQUEST_LIST";
18697 const EXTRA_CRC: u8 = 128u8;
18698 const ENCODED_LEN: usize = 6usize;
18699 fn deser(
18700 _version: MavlinkVersion,
18701 __input: &[u8],
18702 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18703 let avail_len = __input.len();
18704 let mut payload_buf = [0; Self::ENCODED_LEN];
18705 let mut buf = if avail_len < Self::ENCODED_LEN {
18706 payload_buf[0..avail_len].copy_from_slice(__input);
18707 Bytes::new(&payload_buf)
18708 } else {
18709 Bytes::new(__input)
18710 };
18711 let mut __struct = Self::default();
18712 __struct.start = buf.get_u16_le();
18713 __struct.end = buf.get_u16_le();
18714 __struct.target_system = buf.get_u8();
18715 __struct.target_component = buf.get_u8();
18716 Ok(__struct)
18717 }
18718 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18719 let mut __tmp = BytesMut::new(bytes);
18720 #[allow(clippy::absurd_extreme_comparisons)]
18721 #[allow(unused_comparisons)]
18722 if __tmp.remaining() < Self::ENCODED_LEN {
18723 panic!(
18724 "buffer is too small (need {} bytes, but got {})",
18725 Self::ENCODED_LEN,
18726 __tmp.remaining(),
18727 )
18728 }
18729 __tmp.put_u16_le(self.start);
18730 __tmp.put_u16_le(self.end);
18731 __tmp.put_u8(self.target_system);
18732 __tmp.put_u8(self.target_component);
18733 if matches!(version, MavlinkVersion::V2) {
18734 let len = __tmp.len();
18735 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18736 } else {
18737 __tmp.len()
18738 }
18739 }
18740}
18741#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18742#[doc = ""]
18743#[doc = "ID: 192"]
18744#[derive(Debug, Clone, PartialEq)]
18745#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18746#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18747#[cfg_attr(feature = "ts", derive(TS))]
18748#[cfg_attr(feature = "ts", ts(export))]
18749pub struct MAG_CAL_REPORT_DATA {
18750 #[doc = "RMS milligauss residuals."]
18751 pub fitness: f32,
18752 #[doc = "X offset."]
18753 pub ofs_x: f32,
18754 #[doc = "Y offset."]
18755 pub ofs_y: f32,
18756 #[doc = "Z offset."]
18757 pub ofs_z: f32,
18758 #[doc = "X diagonal (matrix 11)."]
18759 pub diag_x: f32,
18760 #[doc = "Y diagonal (matrix 22)."]
18761 pub diag_y: f32,
18762 #[doc = "Z diagonal (matrix 33)."]
18763 pub diag_z: f32,
18764 #[doc = "X off-diagonal (matrix 12 and 21)."]
18765 pub offdiag_x: f32,
18766 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18767 pub offdiag_y: f32,
18768 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18769 pub offdiag_z: f32,
18770 #[doc = "Compass being calibrated."]
18771 pub compass_id: u8,
18772 #[doc = "Bitmask of compasses being calibrated."]
18773 pub cal_mask: u8,
18774 #[doc = "Calibration Status."]
18775 pub cal_status: MagCalStatus,
18776 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18777 pub autosaved: u8,
18778 #[doc = "Confidence in orientation (higher is better)."]
18779 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18780 pub orientation_confidence: f32,
18781 #[doc = "orientation before calibration."]
18782 #[cfg_attr(feature = "serde", serde(default))]
18783 pub old_orientation: MavSensorOrientation,
18784 #[doc = "orientation after calibration."]
18785 #[cfg_attr(feature = "serde", serde(default))]
18786 pub new_orientation: MavSensorOrientation,
18787 #[doc = "field radius correction factor"]
18788 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18789 pub scale_factor: f32,
18790}
18791impl MAG_CAL_REPORT_DATA {
18792 pub const ENCODED_LEN: usize = 54usize;
18793 pub const DEFAULT: Self = Self {
18794 fitness: 0.0_f32,
18795 ofs_x: 0.0_f32,
18796 ofs_y: 0.0_f32,
18797 ofs_z: 0.0_f32,
18798 diag_x: 0.0_f32,
18799 diag_y: 0.0_f32,
18800 diag_z: 0.0_f32,
18801 offdiag_x: 0.0_f32,
18802 offdiag_y: 0.0_f32,
18803 offdiag_z: 0.0_f32,
18804 compass_id: 0_u8,
18805 cal_mask: 0_u8,
18806 cal_status: MagCalStatus::DEFAULT,
18807 autosaved: 0_u8,
18808 orientation_confidence: 0.0_f32,
18809 old_orientation: MavSensorOrientation::DEFAULT,
18810 new_orientation: MavSensorOrientation::DEFAULT,
18811 scale_factor: 0.0_f32,
18812 };
18813 #[cfg(feature = "arbitrary")]
18814 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18815 use arbitrary::{Arbitrary, Unstructured};
18816 let mut buf = [0u8; 1024];
18817 rng.fill_bytes(&mut buf);
18818 let mut unstructured = Unstructured::new(&buf);
18819 Self::arbitrary(&mut unstructured).unwrap_or_default()
18820 }
18821}
18822impl Default for MAG_CAL_REPORT_DATA {
18823 fn default() -> Self {
18824 Self::DEFAULT.clone()
18825 }
18826}
18827impl MessageData for MAG_CAL_REPORT_DATA {
18828 type Message = MavMessage;
18829 const ID: u32 = 192u32;
18830 const NAME: &'static str = "MAG_CAL_REPORT";
18831 const EXTRA_CRC: u8 = 36u8;
18832 const ENCODED_LEN: usize = 54usize;
18833 fn deser(
18834 _version: MavlinkVersion,
18835 __input: &[u8],
18836 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18837 let avail_len = __input.len();
18838 let mut payload_buf = [0; Self::ENCODED_LEN];
18839 let mut buf = if avail_len < Self::ENCODED_LEN {
18840 payload_buf[0..avail_len].copy_from_slice(__input);
18841 Bytes::new(&payload_buf)
18842 } else {
18843 Bytes::new(__input)
18844 };
18845 let mut __struct = Self::default();
18846 __struct.fitness = buf.get_f32_le();
18847 __struct.ofs_x = buf.get_f32_le();
18848 __struct.ofs_y = buf.get_f32_le();
18849 __struct.ofs_z = buf.get_f32_le();
18850 __struct.diag_x = buf.get_f32_le();
18851 __struct.diag_y = buf.get_f32_le();
18852 __struct.diag_z = buf.get_f32_le();
18853 __struct.offdiag_x = buf.get_f32_le();
18854 __struct.offdiag_y = buf.get_f32_le();
18855 __struct.offdiag_z = buf.get_f32_le();
18856 __struct.compass_id = buf.get_u8();
18857 __struct.cal_mask = buf.get_u8();
18858 let tmp = buf.get_u8();
18859 __struct.cal_status =
18860 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18861 enum_type: "MagCalStatus",
18862 value: tmp as u32,
18863 })?;
18864 __struct.autosaved = buf.get_u8();
18865 __struct.orientation_confidence = buf.get_f32_le();
18866 let tmp = buf.get_u8();
18867 __struct.old_orientation =
18868 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18869 enum_type: "MavSensorOrientation",
18870 value: tmp as u32,
18871 })?;
18872 let tmp = buf.get_u8();
18873 __struct.new_orientation =
18874 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18875 enum_type: "MavSensorOrientation",
18876 value: tmp as u32,
18877 })?;
18878 __struct.scale_factor = buf.get_f32_le();
18879 Ok(__struct)
18880 }
18881 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18882 let mut __tmp = BytesMut::new(bytes);
18883 #[allow(clippy::absurd_extreme_comparisons)]
18884 #[allow(unused_comparisons)]
18885 if __tmp.remaining() < Self::ENCODED_LEN {
18886 panic!(
18887 "buffer is too small (need {} bytes, but got {})",
18888 Self::ENCODED_LEN,
18889 __tmp.remaining(),
18890 )
18891 }
18892 __tmp.put_f32_le(self.fitness);
18893 __tmp.put_f32_le(self.ofs_x);
18894 __tmp.put_f32_le(self.ofs_y);
18895 __tmp.put_f32_le(self.ofs_z);
18896 __tmp.put_f32_le(self.diag_x);
18897 __tmp.put_f32_le(self.diag_y);
18898 __tmp.put_f32_le(self.diag_z);
18899 __tmp.put_f32_le(self.offdiag_x);
18900 __tmp.put_f32_le(self.offdiag_y);
18901 __tmp.put_f32_le(self.offdiag_z);
18902 __tmp.put_u8(self.compass_id);
18903 __tmp.put_u8(self.cal_mask);
18904 __tmp.put_u8(self.cal_status as u8);
18905 __tmp.put_u8(self.autosaved);
18906 if matches!(version, MavlinkVersion::V2) {
18907 __tmp.put_f32_le(self.orientation_confidence);
18908 __tmp.put_u8(self.old_orientation as u8);
18909 __tmp.put_u8(self.new_orientation as u8);
18910 __tmp.put_f32_le(self.scale_factor);
18911 let len = __tmp.len();
18912 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18913 } else {
18914 __tmp.len()
18915 }
18916 }
18917}
18918#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18919#[doc = ""]
18920#[doc = "ID: 69"]
18921#[derive(Debug, Clone, PartialEq)]
18922#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18924#[cfg_attr(feature = "ts", derive(TS))]
18925#[cfg_attr(feature = "ts", ts(export))]
18926pub struct MANUAL_CONTROL_DATA {
18927 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18928 pub x: i16,
18929 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18930 pub y: i16,
18931 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18932 pub z: i16,
18933 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18934 pub r: i16,
18935 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18936 pub buttons: u16,
18937 #[doc = "The system to be controlled."]
18938 pub target: u8,
18939 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18940 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18941 pub buttons2: u16,
18942 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18943 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18944 pub enabled_extensions: u8,
18945 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18946 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18947 pub s: i16,
18948 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18949 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18950 pub t: i16,
18951 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18952 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18953 pub aux1: i16,
18954 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18955 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18956 pub aux2: i16,
18957 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18958 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18959 pub aux3: i16,
18960 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18961 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18962 pub aux4: i16,
18963 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18964 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18965 pub aux5: i16,
18966 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18967 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18968 pub aux6: i16,
18969}
18970impl MANUAL_CONTROL_DATA {
18971 pub const ENCODED_LEN: usize = 30usize;
18972 pub const DEFAULT: Self = Self {
18973 x: 0_i16,
18974 y: 0_i16,
18975 z: 0_i16,
18976 r: 0_i16,
18977 buttons: 0_u16,
18978 target: 0_u8,
18979 buttons2: 0_u16,
18980 enabled_extensions: 0_u8,
18981 s: 0_i16,
18982 t: 0_i16,
18983 aux1: 0_i16,
18984 aux2: 0_i16,
18985 aux3: 0_i16,
18986 aux4: 0_i16,
18987 aux5: 0_i16,
18988 aux6: 0_i16,
18989 };
18990 #[cfg(feature = "arbitrary")]
18991 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18992 use arbitrary::{Arbitrary, Unstructured};
18993 let mut buf = [0u8; 1024];
18994 rng.fill_bytes(&mut buf);
18995 let mut unstructured = Unstructured::new(&buf);
18996 Self::arbitrary(&mut unstructured).unwrap_or_default()
18997 }
18998}
18999impl Default for MANUAL_CONTROL_DATA {
19000 fn default() -> Self {
19001 Self::DEFAULT.clone()
19002 }
19003}
19004impl MessageData for MANUAL_CONTROL_DATA {
19005 type Message = MavMessage;
19006 const ID: u32 = 69u32;
19007 const NAME: &'static str = "MANUAL_CONTROL";
19008 const EXTRA_CRC: u8 = 243u8;
19009 const ENCODED_LEN: usize = 30usize;
19010 fn deser(
19011 _version: MavlinkVersion,
19012 __input: &[u8],
19013 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19014 let avail_len = __input.len();
19015 let mut payload_buf = [0; Self::ENCODED_LEN];
19016 let mut buf = if avail_len < Self::ENCODED_LEN {
19017 payload_buf[0..avail_len].copy_from_slice(__input);
19018 Bytes::new(&payload_buf)
19019 } else {
19020 Bytes::new(__input)
19021 };
19022 let mut __struct = Self::default();
19023 __struct.x = buf.get_i16_le();
19024 __struct.y = buf.get_i16_le();
19025 __struct.z = buf.get_i16_le();
19026 __struct.r = buf.get_i16_le();
19027 __struct.buttons = buf.get_u16_le();
19028 __struct.target = buf.get_u8();
19029 __struct.buttons2 = buf.get_u16_le();
19030 __struct.enabled_extensions = buf.get_u8();
19031 __struct.s = buf.get_i16_le();
19032 __struct.t = buf.get_i16_le();
19033 __struct.aux1 = buf.get_i16_le();
19034 __struct.aux2 = buf.get_i16_le();
19035 __struct.aux3 = buf.get_i16_le();
19036 __struct.aux4 = buf.get_i16_le();
19037 __struct.aux5 = buf.get_i16_le();
19038 __struct.aux6 = buf.get_i16_le();
19039 Ok(__struct)
19040 }
19041 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19042 let mut __tmp = BytesMut::new(bytes);
19043 #[allow(clippy::absurd_extreme_comparisons)]
19044 #[allow(unused_comparisons)]
19045 if __tmp.remaining() < Self::ENCODED_LEN {
19046 panic!(
19047 "buffer is too small (need {} bytes, but got {})",
19048 Self::ENCODED_LEN,
19049 __tmp.remaining(),
19050 )
19051 }
19052 __tmp.put_i16_le(self.x);
19053 __tmp.put_i16_le(self.y);
19054 __tmp.put_i16_le(self.z);
19055 __tmp.put_i16_le(self.r);
19056 __tmp.put_u16_le(self.buttons);
19057 __tmp.put_u8(self.target);
19058 if matches!(version, MavlinkVersion::V2) {
19059 __tmp.put_u16_le(self.buttons2);
19060 __tmp.put_u8(self.enabled_extensions);
19061 __tmp.put_i16_le(self.s);
19062 __tmp.put_i16_le(self.t);
19063 __tmp.put_i16_le(self.aux1);
19064 __tmp.put_i16_le(self.aux2);
19065 __tmp.put_i16_le(self.aux3);
19066 __tmp.put_i16_le(self.aux4);
19067 __tmp.put_i16_le(self.aux5);
19068 __tmp.put_i16_le(self.aux6);
19069 let len = __tmp.len();
19070 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19071 } else {
19072 __tmp.len()
19073 }
19074 }
19075}
19076#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19077#[doc = ""]
19078#[doc = "ID: 81"]
19079#[derive(Debug, Clone, PartialEq)]
19080#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19081#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19082#[cfg_attr(feature = "ts", derive(TS))]
19083#[cfg_attr(feature = "ts", ts(export))]
19084pub struct MANUAL_SETPOINT_DATA {
19085 #[doc = "Timestamp (time since system boot)."]
19086 pub time_boot_ms: u32,
19087 #[doc = "Desired roll rate"]
19088 pub roll: f32,
19089 #[doc = "Desired pitch rate"]
19090 pub pitch: f32,
19091 #[doc = "Desired yaw rate"]
19092 pub yaw: f32,
19093 #[doc = "Collective thrust, normalized to 0 .. 1"]
19094 pub thrust: f32,
19095 #[doc = "Flight mode switch position, 0.. 255"]
19096 pub mode_switch: u8,
19097 #[doc = "Override mode switch position, 0.. 255"]
19098 pub manual_override_switch: u8,
19099}
19100impl MANUAL_SETPOINT_DATA {
19101 pub const ENCODED_LEN: usize = 22usize;
19102 pub const DEFAULT: Self = Self {
19103 time_boot_ms: 0_u32,
19104 roll: 0.0_f32,
19105 pitch: 0.0_f32,
19106 yaw: 0.0_f32,
19107 thrust: 0.0_f32,
19108 mode_switch: 0_u8,
19109 manual_override_switch: 0_u8,
19110 };
19111 #[cfg(feature = "arbitrary")]
19112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19113 use arbitrary::{Arbitrary, Unstructured};
19114 let mut buf = [0u8; 1024];
19115 rng.fill_bytes(&mut buf);
19116 let mut unstructured = Unstructured::new(&buf);
19117 Self::arbitrary(&mut unstructured).unwrap_or_default()
19118 }
19119}
19120impl Default for MANUAL_SETPOINT_DATA {
19121 fn default() -> Self {
19122 Self::DEFAULT.clone()
19123 }
19124}
19125impl MessageData for MANUAL_SETPOINT_DATA {
19126 type Message = MavMessage;
19127 const ID: u32 = 81u32;
19128 const NAME: &'static str = "MANUAL_SETPOINT";
19129 const EXTRA_CRC: u8 = 106u8;
19130 const ENCODED_LEN: usize = 22usize;
19131 fn deser(
19132 _version: MavlinkVersion,
19133 __input: &[u8],
19134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19135 let avail_len = __input.len();
19136 let mut payload_buf = [0; Self::ENCODED_LEN];
19137 let mut buf = if avail_len < Self::ENCODED_LEN {
19138 payload_buf[0..avail_len].copy_from_slice(__input);
19139 Bytes::new(&payload_buf)
19140 } else {
19141 Bytes::new(__input)
19142 };
19143 let mut __struct = Self::default();
19144 __struct.time_boot_ms = buf.get_u32_le();
19145 __struct.roll = buf.get_f32_le();
19146 __struct.pitch = buf.get_f32_le();
19147 __struct.yaw = buf.get_f32_le();
19148 __struct.thrust = buf.get_f32_le();
19149 __struct.mode_switch = buf.get_u8();
19150 __struct.manual_override_switch = buf.get_u8();
19151 Ok(__struct)
19152 }
19153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19154 let mut __tmp = BytesMut::new(bytes);
19155 #[allow(clippy::absurd_extreme_comparisons)]
19156 #[allow(unused_comparisons)]
19157 if __tmp.remaining() < Self::ENCODED_LEN {
19158 panic!(
19159 "buffer is too small (need {} bytes, but got {})",
19160 Self::ENCODED_LEN,
19161 __tmp.remaining(),
19162 )
19163 }
19164 __tmp.put_u32_le(self.time_boot_ms);
19165 __tmp.put_f32_le(self.roll);
19166 __tmp.put_f32_le(self.pitch);
19167 __tmp.put_f32_le(self.yaw);
19168 __tmp.put_f32_le(self.thrust);
19169 __tmp.put_u8(self.mode_switch);
19170 __tmp.put_u8(self.manual_override_switch);
19171 if matches!(version, MavlinkVersion::V2) {
19172 let len = __tmp.len();
19173 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19174 } else {
19175 __tmp.len()
19176 }
19177 }
19178}
19179#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19180#[doc = ""]
19181#[doc = "ID: 249"]
19182#[derive(Debug, Clone, PartialEq)]
19183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19185#[cfg_attr(feature = "ts", derive(TS))]
19186#[cfg_attr(feature = "ts", ts(export))]
19187pub struct MEMORY_VECT_DATA {
19188 #[doc = "Starting address of the debug variables"]
19189 pub address: u16,
19190 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19191 pub ver: u8,
19192 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19193 pub mavtype: u8,
19194 #[doc = "Memory contents at specified address"]
19195 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19196 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19197 pub value: [i8; 32],
19198}
19199impl MEMORY_VECT_DATA {
19200 pub const ENCODED_LEN: usize = 36usize;
19201 pub const DEFAULT: Self = Self {
19202 address: 0_u16,
19203 ver: 0_u8,
19204 mavtype: 0_u8,
19205 value: [0_i8; 32usize],
19206 };
19207 #[cfg(feature = "arbitrary")]
19208 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19209 use arbitrary::{Arbitrary, Unstructured};
19210 let mut buf = [0u8; 1024];
19211 rng.fill_bytes(&mut buf);
19212 let mut unstructured = Unstructured::new(&buf);
19213 Self::arbitrary(&mut unstructured).unwrap_or_default()
19214 }
19215}
19216impl Default for MEMORY_VECT_DATA {
19217 fn default() -> Self {
19218 Self::DEFAULT.clone()
19219 }
19220}
19221impl MessageData for MEMORY_VECT_DATA {
19222 type Message = MavMessage;
19223 const ID: u32 = 249u32;
19224 const NAME: &'static str = "MEMORY_VECT";
19225 const EXTRA_CRC: u8 = 204u8;
19226 const ENCODED_LEN: usize = 36usize;
19227 fn deser(
19228 _version: MavlinkVersion,
19229 __input: &[u8],
19230 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19231 let avail_len = __input.len();
19232 let mut payload_buf = [0; Self::ENCODED_LEN];
19233 let mut buf = if avail_len < Self::ENCODED_LEN {
19234 payload_buf[0..avail_len].copy_from_slice(__input);
19235 Bytes::new(&payload_buf)
19236 } else {
19237 Bytes::new(__input)
19238 };
19239 let mut __struct = Self::default();
19240 __struct.address = buf.get_u16_le();
19241 __struct.ver = buf.get_u8();
19242 __struct.mavtype = buf.get_u8();
19243 for v in &mut __struct.value {
19244 let val = buf.get_i8();
19245 *v = val;
19246 }
19247 Ok(__struct)
19248 }
19249 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19250 let mut __tmp = BytesMut::new(bytes);
19251 #[allow(clippy::absurd_extreme_comparisons)]
19252 #[allow(unused_comparisons)]
19253 if __tmp.remaining() < Self::ENCODED_LEN {
19254 panic!(
19255 "buffer is too small (need {} bytes, but got {})",
19256 Self::ENCODED_LEN,
19257 __tmp.remaining(),
19258 )
19259 }
19260 __tmp.put_u16_le(self.address);
19261 __tmp.put_u8(self.ver);
19262 __tmp.put_u8(self.mavtype);
19263 for val in &self.value {
19264 __tmp.put_i8(*val);
19265 }
19266 if matches!(version, MavlinkVersion::V2) {
19267 let len = __tmp.len();
19268 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19269 } else {
19270 __tmp.len()
19271 }
19272 }
19273}
19274#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19275#[doc = ""]
19276#[doc = "ID: 244"]
19277#[derive(Debug, Clone, PartialEq)]
19278#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19279#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19280#[cfg_attr(feature = "ts", derive(TS))]
19281#[cfg_attr(feature = "ts", ts(export))]
19282pub struct MESSAGE_INTERVAL_DATA {
19283 #[doc = "0 indicates the interval at which it is sent."]
19284 pub interval_us: i32,
19285 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19286 pub message_id: u16,
19287}
19288impl MESSAGE_INTERVAL_DATA {
19289 pub const ENCODED_LEN: usize = 6usize;
19290 pub const DEFAULT: Self = Self {
19291 interval_us: 0_i32,
19292 message_id: 0_u16,
19293 };
19294 #[cfg(feature = "arbitrary")]
19295 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19296 use arbitrary::{Arbitrary, Unstructured};
19297 let mut buf = [0u8; 1024];
19298 rng.fill_bytes(&mut buf);
19299 let mut unstructured = Unstructured::new(&buf);
19300 Self::arbitrary(&mut unstructured).unwrap_or_default()
19301 }
19302}
19303impl Default for MESSAGE_INTERVAL_DATA {
19304 fn default() -> Self {
19305 Self::DEFAULT.clone()
19306 }
19307}
19308impl MessageData for MESSAGE_INTERVAL_DATA {
19309 type Message = MavMessage;
19310 const ID: u32 = 244u32;
19311 const NAME: &'static str = "MESSAGE_INTERVAL";
19312 const EXTRA_CRC: u8 = 95u8;
19313 const ENCODED_LEN: usize = 6usize;
19314 fn deser(
19315 _version: MavlinkVersion,
19316 __input: &[u8],
19317 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19318 let avail_len = __input.len();
19319 let mut payload_buf = [0; Self::ENCODED_LEN];
19320 let mut buf = if avail_len < Self::ENCODED_LEN {
19321 payload_buf[0..avail_len].copy_from_slice(__input);
19322 Bytes::new(&payload_buf)
19323 } else {
19324 Bytes::new(__input)
19325 };
19326 let mut __struct = Self::default();
19327 __struct.interval_us = buf.get_i32_le();
19328 __struct.message_id = buf.get_u16_le();
19329 Ok(__struct)
19330 }
19331 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19332 let mut __tmp = BytesMut::new(bytes);
19333 #[allow(clippy::absurd_extreme_comparisons)]
19334 #[allow(unused_comparisons)]
19335 if __tmp.remaining() < Self::ENCODED_LEN {
19336 panic!(
19337 "buffer is too small (need {} bytes, but got {})",
19338 Self::ENCODED_LEN,
19339 __tmp.remaining(),
19340 )
19341 }
19342 __tmp.put_i32_le(self.interval_us);
19343 __tmp.put_u16_le(self.message_id);
19344 if matches!(version, MavlinkVersion::V2) {
19345 let len = __tmp.len();
19346 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19347 } else {
19348 __tmp.len()
19349 }
19350 }
19351}
19352#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19353#[doc = ""]
19354#[doc = "ID: 47"]
19355#[derive(Debug, Clone, PartialEq)]
19356#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19357#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19358#[cfg_attr(feature = "ts", derive(TS))]
19359#[cfg_attr(feature = "ts", ts(export))]
19360pub struct MISSION_ACK_DATA {
19361 #[doc = "System ID"]
19362 pub target_system: u8,
19363 #[doc = "Component ID"]
19364 pub target_component: u8,
19365 #[doc = "Mission result."]
19366 pub mavtype: MavMissionResult,
19367 #[doc = "Mission type."]
19368 #[cfg_attr(feature = "serde", serde(default))]
19369 pub mission_type: MavMissionType,
19370 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19371 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19372 pub opaque_id: u32,
19373}
19374impl MISSION_ACK_DATA {
19375 pub const ENCODED_LEN: usize = 8usize;
19376 pub const DEFAULT: Self = Self {
19377 target_system: 0_u8,
19378 target_component: 0_u8,
19379 mavtype: MavMissionResult::DEFAULT,
19380 mission_type: MavMissionType::DEFAULT,
19381 opaque_id: 0_u32,
19382 };
19383 #[cfg(feature = "arbitrary")]
19384 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19385 use arbitrary::{Arbitrary, Unstructured};
19386 let mut buf = [0u8; 1024];
19387 rng.fill_bytes(&mut buf);
19388 let mut unstructured = Unstructured::new(&buf);
19389 Self::arbitrary(&mut unstructured).unwrap_or_default()
19390 }
19391}
19392impl Default for MISSION_ACK_DATA {
19393 fn default() -> Self {
19394 Self::DEFAULT.clone()
19395 }
19396}
19397impl MessageData for MISSION_ACK_DATA {
19398 type Message = MavMessage;
19399 const ID: u32 = 47u32;
19400 const NAME: &'static str = "MISSION_ACK";
19401 const EXTRA_CRC: u8 = 153u8;
19402 const ENCODED_LEN: usize = 8usize;
19403 fn deser(
19404 _version: MavlinkVersion,
19405 __input: &[u8],
19406 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19407 let avail_len = __input.len();
19408 let mut payload_buf = [0; Self::ENCODED_LEN];
19409 let mut buf = if avail_len < Self::ENCODED_LEN {
19410 payload_buf[0..avail_len].copy_from_slice(__input);
19411 Bytes::new(&payload_buf)
19412 } else {
19413 Bytes::new(__input)
19414 };
19415 let mut __struct = Self::default();
19416 __struct.target_system = buf.get_u8();
19417 __struct.target_component = buf.get_u8();
19418 let tmp = buf.get_u8();
19419 __struct.mavtype =
19420 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19421 enum_type: "MavMissionResult",
19422 value: tmp as u32,
19423 })?;
19424 let tmp = buf.get_u8();
19425 __struct.mission_type =
19426 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19427 enum_type: "MavMissionType",
19428 value: tmp as u32,
19429 })?;
19430 __struct.opaque_id = buf.get_u32_le();
19431 Ok(__struct)
19432 }
19433 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19434 let mut __tmp = BytesMut::new(bytes);
19435 #[allow(clippy::absurd_extreme_comparisons)]
19436 #[allow(unused_comparisons)]
19437 if __tmp.remaining() < Self::ENCODED_LEN {
19438 panic!(
19439 "buffer is too small (need {} bytes, but got {})",
19440 Self::ENCODED_LEN,
19441 __tmp.remaining(),
19442 )
19443 }
19444 __tmp.put_u8(self.target_system);
19445 __tmp.put_u8(self.target_component);
19446 __tmp.put_u8(self.mavtype as u8);
19447 if matches!(version, MavlinkVersion::V2) {
19448 __tmp.put_u8(self.mission_type as u8);
19449 __tmp.put_u32_le(self.opaque_id);
19450 let len = __tmp.len();
19451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19452 } else {
19453 __tmp.len()
19454 }
19455 }
19456}
19457#[doc = "Delete all mission items at once."]
19458#[doc = ""]
19459#[doc = "ID: 45"]
19460#[derive(Debug, Clone, PartialEq)]
19461#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19462#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19463#[cfg_attr(feature = "ts", derive(TS))]
19464#[cfg_attr(feature = "ts", ts(export))]
19465pub struct MISSION_CLEAR_ALL_DATA {
19466 #[doc = "System ID"]
19467 pub target_system: u8,
19468 #[doc = "Component ID"]
19469 pub target_component: u8,
19470 #[doc = "Mission type."]
19471 #[cfg_attr(feature = "serde", serde(default))]
19472 pub mission_type: MavMissionType,
19473}
19474impl MISSION_CLEAR_ALL_DATA {
19475 pub const ENCODED_LEN: usize = 3usize;
19476 pub const DEFAULT: Self = Self {
19477 target_system: 0_u8,
19478 target_component: 0_u8,
19479 mission_type: MavMissionType::DEFAULT,
19480 };
19481 #[cfg(feature = "arbitrary")]
19482 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19483 use arbitrary::{Arbitrary, Unstructured};
19484 let mut buf = [0u8; 1024];
19485 rng.fill_bytes(&mut buf);
19486 let mut unstructured = Unstructured::new(&buf);
19487 Self::arbitrary(&mut unstructured).unwrap_or_default()
19488 }
19489}
19490impl Default for MISSION_CLEAR_ALL_DATA {
19491 fn default() -> Self {
19492 Self::DEFAULT.clone()
19493 }
19494}
19495impl MessageData for MISSION_CLEAR_ALL_DATA {
19496 type Message = MavMessage;
19497 const ID: u32 = 45u32;
19498 const NAME: &'static str = "MISSION_CLEAR_ALL";
19499 const EXTRA_CRC: u8 = 232u8;
19500 const ENCODED_LEN: usize = 3usize;
19501 fn deser(
19502 _version: MavlinkVersion,
19503 __input: &[u8],
19504 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19505 let avail_len = __input.len();
19506 let mut payload_buf = [0; Self::ENCODED_LEN];
19507 let mut buf = if avail_len < Self::ENCODED_LEN {
19508 payload_buf[0..avail_len].copy_from_slice(__input);
19509 Bytes::new(&payload_buf)
19510 } else {
19511 Bytes::new(__input)
19512 };
19513 let mut __struct = Self::default();
19514 __struct.target_system = buf.get_u8();
19515 __struct.target_component = buf.get_u8();
19516 let tmp = buf.get_u8();
19517 __struct.mission_type =
19518 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19519 enum_type: "MavMissionType",
19520 value: tmp as u32,
19521 })?;
19522 Ok(__struct)
19523 }
19524 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19525 let mut __tmp = BytesMut::new(bytes);
19526 #[allow(clippy::absurd_extreme_comparisons)]
19527 #[allow(unused_comparisons)]
19528 if __tmp.remaining() < Self::ENCODED_LEN {
19529 panic!(
19530 "buffer is too small (need {} bytes, but got {})",
19531 Self::ENCODED_LEN,
19532 __tmp.remaining(),
19533 )
19534 }
19535 __tmp.put_u8(self.target_system);
19536 __tmp.put_u8(self.target_component);
19537 if matches!(version, MavlinkVersion::V2) {
19538 __tmp.put_u8(self.mission_type as u8);
19539 let len = __tmp.len();
19540 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19541 } else {
19542 __tmp.len()
19543 }
19544 }
19545}
19546#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19547#[doc = ""]
19548#[doc = "ID: 44"]
19549#[derive(Debug, Clone, PartialEq)]
19550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19551#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19552#[cfg_attr(feature = "ts", derive(TS))]
19553#[cfg_attr(feature = "ts", ts(export))]
19554pub struct MISSION_COUNT_DATA {
19555 #[doc = "Number of mission items in the sequence"]
19556 pub count: u16,
19557 #[doc = "System ID"]
19558 pub target_system: u8,
19559 #[doc = "Component ID"]
19560 pub target_component: u8,
19561 #[doc = "Mission type."]
19562 #[cfg_attr(feature = "serde", serde(default))]
19563 pub mission_type: MavMissionType,
19564 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19565 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19566 pub opaque_id: u32,
19567}
19568impl MISSION_COUNT_DATA {
19569 pub const ENCODED_LEN: usize = 9usize;
19570 pub const DEFAULT: Self = Self {
19571 count: 0_u16,
19572 target_system: 0_u8,
19573 target_component: 0_u8,
19574 mission_type: MavMissionType::DEFAULT,
19575 opaque_id: 0_u32,
19576 };
19577 #[cfg(feature = "arbitrary")]
19578 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19579 use arbitrary::{Arbitrary, Unstructured};
19580 let mut buf = [0u8; 1024];
19581 rng.fill_bytes(&mut buf);
19582 let mut unstructured = Unstructured::new(&buf);
19583 Self::arbitrary(&mut unstructured).unwrap_or_default()
19584 }
19585}
19586impl Default for MISSION_COUNT_DATA {
19587 fn default() -> Self {
19588 Self::DEFAULT.clone()
19589 }
19590}
19591impl MessageData for MISSION_COUNT_DATA {
19592 type Message = MavMessage;
19593 const ID: u32 = 44u32;
19594 const NAME: &'static str = "MISSION_COUNT";
19595 const EXTRA_CRC: u8 = 221u8;
19596 const ENCODED_LEN: usize = 9usize;
19597 fn deser(
19598 _version: MavlinkVersion,
19599 __input: &[u8],
19600 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19601 let avail_len = __input.len();
19602 let mut payload_buf = [0; Self::ENCODED_LEN];
19603 let mut buf = if avail_len < Self::ENCODED_LEN {
19604 payload_buf[0..avail_len].copy_from_slice(__input);
19605 Bytes::new(&payload_buf)
19606 } else {
19607 Bytes::new(__input)
19608 };
19609 let mut __struct = Self::default();
19610 __struct.count = buf.get_u16_le();
19611 __struct.target_system = buf.get_u8();
19612 __struct.target_component = buf.get_u8();
19613 let tmp = buf.get_u8();
19614 __struct.mission_type =
19615 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19616 enum_type: "MavMissionType",
19617 value: tmp as u32,
19618 })?;
19619 __struct.opaque_id = buf.get_u32_le();
19620 Ok(__struct)
19621 }
19622 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19623 let mut __tmp = BytesMut::new(bytes);
19624 #[allow(clippy::absurd_extreme_comparisons)]
19625 #[allow(unused_comparisons)]
19626 if __tmp.remaining() < Self::ENCODED_LEN {
19627 panic!(
19628 "buffer is too small (need {} bytes, but got {})",
19629 Self::ENCODED_LEN,
19630 __tmp.remaining(),
19631 )
19632 }
19633 __tmp.put_u16_le(self.count);
19634 __tmp.put_u8(self.target_system);
19635 __tmp.put_u8(self.target_component);
19636 if matches!(version, MavlinkVersion::V2) {
19637 __tmp.put_u8(self.mission_type as u8);
19638 __tmp.put_u32_le(self.opaque_id);
19639 let len = __tmp.len();
19640 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19641 } else {
19642 __tmp.len()
19643 }
19644 }
19645}
19646#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19647#[doc = ""]
19648#[doc = "ID: 42"]
19649#[derive(Debug, Clone, PartialEq)]
19650#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19651#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19652#[cfg_attr(feature = "ts", derive(TS))]
19653#[cfg_attr(feature = "ts", ts(export))]
19654pub struct MISSION_CURRENT_DATA {
19655 #[doc = "Sequence"]
19656 pub seq: u16,
19657 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19658 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19659 pub total: u16,
19660 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19661 #[cfg_attr(feature = "serde", serde(default))]
19662 pub mission_state: MissionState,
19663 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19664 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19665 pub mission_mode: u8,
19666 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19667 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19668 pub mission_id: u32,
19669 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19670 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19671 pub fence_id: u32,
19672 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19673 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19674 pub rally_points_id: u32,
19675}
19676impl MISSION_CURRENT_DATA {
19677 pub const ENCODED_LEN: usize = 18usize;
19678 pub const DEFAULT: Self = Self {
19679 seq: 0_u16,
19680 total: 0_u16,
19681 mission_state: MissionState::DEFAULT,
19682 mission_mode: 0_u8,
19683 mission_id: 0_u32,
19684 fence_id: 0_u32,
19685 rally_points_id: 0_u32,
19686 };
19687 #[cfg(feature = "arbitrary")]
19688 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19689 use arbitrary::{Arbitrary, Unstructured};
19690 let mut buf = [0u8; 1024];
19691 rng.fill_bytes(&mut buf);
19692 let mut unstructured = Unstructured::new(&buf);
19693 Self::arbitrary(&mut unstructured).unwrap_or_default()
19694 }
19695}
19696impl Default for MISSION_CURRENT_DATA {
19697 fn default() -> Self {
19698 Self::DEFAULT.clone()
19699 }
19700}
19701impl MessageData for MISSION_CURRENT_DATA {
19702 type Message = MavMessage;
19703 const ID: u32 = 42u32;
19704 const NAME: &'static str = "MISSION_CURRENT";
19705 const EXTRA_CRC: u8 = 28u8;
19706 const ENCODED_LEN: usize = 18usize;
19707 fn deser(
19708 _version: MavlinkVersion,
19709 __input: &[u8],
19710 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19711 let avail_len = __input.len();
19712 let mut payload_buf = [0; Self::ENCODED_LEN];
19713 let mut buf = if avail_len < Self::ENCODED_LEN {
19714 payload_buf[0..avail_len].copy_from_slice(__input);
19715 Bytes::new(&payload_buf)
19716 } else {
19717 Bytes::new(__input)
19718 };
19719 let mut __struct = Self::default();
19720 __struct.seq = buf.get_u16_le();
19721 __struct.total = buf.get_u16_le();
19722 let tmp = buf.get_u8();
19723 __struct.mission_state =
19724 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19725 enum_type: "MissionState",
19726 value: tmp as u32,
19727 })?;
19728 __struct.mission_mode = buf.get_u8();
19729 __struct.mission_id = buf.get_u32_le();
19730 __struct.fence_id = buf.get_u32_le();
19731 __struct.rally_points_id = buf.get_u32_le();
19732 Ok(__struct)
19733 }
19734 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19735 let mut __tmp = BytesMut::new(bytes);
19736 #[allow(clippy::absurd_extreme_comparisons)]
19737 #[allow(unused_comparisons)]
19738 if __tmp.remaining() < Self::ENCODED_LEN {
19739 panic!(
19740 "buffer is too small (need {} bytes, but got {})",
19741 Self::ENCODED_LEN,
19742 __tmp.remaining(),
19743 )
19744 }
19745 __tmp.put_u16_le(self.seq);
19746 if matches!(version, MavlinkVersion::V2) {
19747 __tmp.put_u16_le(self.total);
19748 __tmp.put_u8(self.mission_state as u8);
19749 __tmp.put_u8(self.mission_mode);
19750 __tmp.put_u32_le(self.mission_id);
19751 __tmp.put_u32_le(self.fence_id);
19752 __tmp.put_u32_le(self.rally_points_id);
19753 let len = __tmp.len();
19754 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19755 } else {
19756 __tmp.len()
19757 }
19758 }
19759}
19760#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19761#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19762#[doc = ""]
19763#[doc = "ID: 39"]
19764#[derive(Debug, Clone, PartialEq)]
19765#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19766#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19767#[cfg_attr(feature = "ts", derive(TS))]
19768#[cfg_attr(feature = "ts", ts(export))]
19769pub struct MISSION_ITEM_DATA {
19770 #[doc = "PARAM1, see MAV_CMD enum"]
19771 pub param1: f32,
19772 #[doc = "PARAM2, see MAV_CMD enum"]
19773 pub param2: f32,
19774 #[doc = "PARAM3, see MAV_CMD enum"]
19775 pub param3: f32,
19776 #[doc = "PARAM4, see MAV_CMD enum"]
19777 pub param4: f32,
19778 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19779 pub x: f32,
19780 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19781 pub y: f32,
19782 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19783 pub z: f32,
19784 #[doc = "Sequence"]
19785 pub seq: u16,
19786 #[doc = "The scheduled action for the waypoint."]
19787 pub command: MavCmd,
19788 #[doc = "System ID"]
19789 pub target_system: u8,
19790 #[doc = "Component ID"]
19791 pub target_component: u8,
19792 #[doc = "The coordinate system of the waypoint."]
19793 pub frame: MavFrame,
19794 #[doc = "false:0, true:1"]
19795 pub current: u8,
19796 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19797 pub autocontinue: u8,
19798 #[doc = "Mission type."]
19799 #[cfg_attr(feature = "serde", serde(default))]
19800 pub mission_type: MavMissionType,
19801}
19802impl MISSION_ITEM_DATA {
19803 pub const ENCODED_LEN: usize = 38usize;
19804 pub const DEFAULT: Self = Self {
19805 param1: 0.0_f32,
19806 param2: 0.0_f32,
19807 param3: 0.0_f32,
19808 param4: 0.0_f32,
19809 x: 0.0_f32,
19810 y: 0.0_f32,
19811 z: 0.0_f32,
19812 seq: 0_u16,
19813 command: MavCmd::DEFAULT,
19814 target_system: 0_u8,
19815 target_component: 0_u8,
19816 frame: MavFrame::DEFAULT,
19817 current: 0_u8,
19818 autocontinue: 0_u8,
19819 mission_type: MavMissionType::DEFAULT,
19820 };
19821 #[cfg(feature = "arbitrary")]
19822 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19823 use arbitrary::{Arbitrary, Unstructured};
19824 let mut buf = [0u8; 1024];
19825 rng.fill_bytes(&mut buf);
19826 let mut unstructured = Unstructured::new(&buf);
19827 Self::arbitrary(&mut unstructured).unwrap_or_default()
19828 }
19829}
19830impl Default for MISSION_ITEM_DATA {
19831 fn default() -> Self {
19832 Self::DEFAULT.clone()
19833 }
19834}
19835impl MessageData for MISSION_ITEM_DATA {
19836 type Message = MavMessage;
19837 const ID: u32 = 39u32;
19838 const NAME: &'static str = "MISSION_ITEM";
19839 const EXTRA_CRC: u8 = 254u8;
19840 const ENCODED_LEN: usize = 38usize;
19841 fn deser(
19842 _version: MavlinkVersion,
19843 __input: &[u8],
19844 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19845 let avail_len = __input.len();
19846 let mut payload_buf = [0; Self::ENCODED_LEN];
19847 let mut buf = if avail_len < Self::ENCODED_LEN {
19848 payload_buf[0..avail_len].copy_from_slice(__input);
19849 Bytes::new(&payload_buf)
19850 } else {
19851 Bytes::new(__input)
19852 };
19853 let mut __struct = Self::default();
19854 __struct.param1 = buf.get_f32_le();
19855 __struct.param2 = buf.get_f32_le();
19856 __struct.param3 = buf.get_f32_le();
19857 __struct.param4 = buf.get_f32_le();
19858 __struct.x = buf.get_f32_le();
19859 __struct.y = buf.get_f32_le();
19860 __struct.z = buf.get_f32_le();
19861 __struct.seq = buf.get_u16_le();
19862 let tmp = buf.get_u16_le();
19863 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19864 ::mavlink_core::error::ParserError::InvalidEnum {
19865 enum_type: "MavCmd",
19866 value: tmp as u32,
19867 },
19868 )?;
19869 __struct.target_system = buf.get_u8();
19870 __struct.target_component = buf.get_u8();
19871 let tmp = buf.get_u8();
19872 __struct.frame =
19873 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19874 enum_type: "MavFrame",
19875 value: tmp as u32,
19876 })?;
19877 __struct.current = buf.get_u8();
19878 __struct.autocontinue = buf.get_u8();
19879 let tmp = buf.get_u8();
19880 __struct.mission_type =
19881 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19882 enum_type: "MavMissionType",
19883 value: tmp as u32,
19884 })?;
19885 Ok(__struct)
19886 }
19887 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19888 let mut __tmp = BytesMut::new(bytes);
19889 #[allow(clippy::absurd_extreme_comparisons)]
19890 #[allow(unused_comparisons)]
19891 if __tmp.remaining() < Self::ENCODED_LEN {
19892 panic!(
19893 "buffer is too small (need {} bytes, but got {})",
19894 Self::ENCODED_LEN,
19895 __tmp.remaining(),
19896 )
19897 }
19898 __tmp.put_f32_le(self.param1);
19899 __tmp.put_f32_le(self.param2);
19900 __tmp.put_f32_le(self.param3);
19901 __tmp.put_f32_le(self.param4);
19902 __tmp.put_f32_le(self.x);
19903 __tmp.put_f32_le(self.y);
19904 __tmp.put_f32_le(self.z);
19905 __tmp.put_u16_le(self.seq);
19906 __tmp.put_u16_le(self.command as u16);
19907 __tmp.put_u8(self.target_system);
19908 __tmp.put_u8(self.target_component);
19909 __tmp.put_u8(self.frame as u8);
19910 __tmp.put_u8(self.current);
19911 __tmp.put_u8(self.autocontinue);
19912 if matches!(version, MavlinkVersion::V2) {
19913 __tmp.put_u8(self.mission_type as u8);
19914 let len = __tmp.len();
19915 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19916 } else {
19917 __tmp.len()
19918 }
19919 }
19920}
19921#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19922#[doc = ""]
19923#[doc = "ID: 73"]
19924#[derive(Debug, Clone, PartialEq)]
19925#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19926#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19927#[cfg_attr(feature = "ts", derive(TS))]
19928#[cfg_attr(feature = "ts", ts(export))]
19929pub struct MISSION_ITEM_INT_DATA {
19930 #[doc = "PARAM1, see MAV_CMD enum"]
19931 pub param1: f32,
19932 #[doc = "PARAM2, see MAV_CMD enum"]
19933 pub param2: f32,
19934 #[doc = "PARAM3, see MAV_CMD enum"]
19935 pub param3: f32,
19936 #[doc = "PARAM4, see MAV_CMD enum"]
19937 pub param4: f32,
19938 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19939 pub x: i32,
19940 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19941 pub y: i32,
19942 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19943 pub z: f32,
19944 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19945 pub seq: u16,
19946 #[doc = "The scheduled action for the waypoint."]
19947 pub command: MavCmd,
19948 #[doc = "System ID"]
19949 pub target_system: u8,
19950 #[doc = "Component ID"]
19951 pub target_component: u8,
19952 #[doc = "The coordinate system of the waypoint."]
19953 pub frame: MavFrame,
19954 #[doc = "false:0, true:1"]
19955 pub current: u8,
19956 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19957 pub autocontinue: u8,
19958 #[doc = "Mission type."]
19959 #[cfg_attr(feature = "serde", serde(default))]
19960 pub mission_type: MavMissionType,
19961}
19962impl MISSION_ITEM_INT_DATA {
19963 pub const ENCODED_LEN: usize = 38usize;
19964 pub const DEFAULT: Self = Self {
19965 param1: 0.0_f32,
19966 param2: 0.0_f32,
19967 param3: 0.0_f32,
19968 param4: 0.0_f32,
19969 x: 0_i32,
19970 y: 0_i32,
19971 z: 0.0_f32,
19972 seq: 0_u16,
19973 command: MavCmd::DEFAULT,
19974 target_system: 0_u8,
19975 target_component: 0_u8,
19976 frame: MavFrame::DEFAULT,
19977 current: 0_u8,
19978 autocontinue: 0_u8,
19979 mission_type: MavMissionType::DEFAULT,
19980 };
19981 #[cfg(feature = "arbitrary")]
19982 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19983 use arbitrary::{Arbitrary, Unstructured};
19984 let mut buf = [0u8; 1024];
19985 rng.fill_bytes(&mut buf);
19986 let mut unstructured = Unstructured::new(&buf);
19987 Self::arbitrary(&mut unstructured).unwrap_or_default()
19988 }
19989}
19990impl Default for MISSION_ITEM_INT_DATA {
19991 fn default() -> Self {
19992 Self::DEFAULT.clone()
19993 }
19994}
19995impl MessageData for MISSION_ITEM_INT_DATA {
19996 type Message = MavMessage;
19997 const ID: u32 = 73u32;
19998 const NAME: &'static str = "MISSION_ITEM_INT";
19999 const EXTRA_CRC: u8 = 38u8;
20000 const ENCODED_LEN: usize = 38usize;
20001 fn deser(
20002 _version: MavlinkVersion,
20003 __input: &[u8],
20004 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20005 let avail_len = __input.len();
20006 let mut payload_buf = [0; Self::ENCODED_LEN];
20007 let mut buf = if avail_len < Self::ENCODED_LEN {
20008 payload_buf[0..avail_len].copy_from_slice(__input);
20009 Bytes::new(&payload_buf)
20010 } else {
20011 Bytes::new(__input)
20012 };
20013 let mut __struct = Self::default();
20014 __struct.param1 = buf.get_f32_le();
20015 __struct.param2 = buf.get_f32_le();
20016 __struct.param3 = buf.get_f32_le();
20017 __struct.param4 = buf.get_f32_le();
20018 __struct.x = buf.get_i32_le();
20019 __struct.y = buf.get_i32_le();
20020 __struct.z = buf.get_f32_le();
20021 __struct.seq = buf.get_u16_le();
20022 let tmp = buf.get_u16_le();
20023 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20024 ::mavlink_core::error::ParserError::InvalidEnum {
20025 enum_type: "MavCmd",
20026 value: tmp as u32,
20027 },
20028 )?;
20029 __struct.target_system = buf.get_u8();
20030 __struct.target_component = buf.get_u8();
20031 let tmp = buf.get_u8();
20032 __struct.frame =
20033 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20034 enum_type: "MavFrame",
20035 value: tmp as u32,
20036 })?;
20037 __struct.current = buf.get_u8();
20038 __struct.autocontinue = buf.get_u8();
20039 let tmp = buf.get_u8();
20040 __struct.mission_type =
20041 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20042 enum_type: "MavMissionType",
20043 value: tmp as u32,
20044 })?;
20045 Ok(__struct)
20046 }
20047 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20048 let mut __tmp = BytesMut::new(bytes);
20049 #[allow(clippy::absurd_extreme_comparisons)]
20050 #[allow(unused_comparisons)]
20051 if __tmp.remaining() < Self::ENCODED_LEN {
20052 panic!(
20053 "buffer is too small (need {} bytes, but got {})",
20054 Self::ENCODED_LEN,
20055 __tmp.remaining(),
20056 )
20057 }
20058 __tmp.put_f32_le(self.param1);
20059 __tmp.put_f32_le(self.param2);
20060 __tmp.put_f32_le(self.param3);
20061 __tmp.put_f32_le(self.param4);
20062 __tmp.put_i32_le(self.x);
20063 __tmp.put_i32_le(self.y);
20064 __tmp.put_f32_le(self.z);
20065 __tmp.put_u16_le(self.seq);
20066 __tmp.put_u16_le(self.command as u16);
20067 __tmp.put_u8(self.target_system);
20068 __tmp.put_u8(self.target_component);
20069 __tmp.put_u8(self.frame as u8);
20070 __tmp.put_u8(self.current);
20071 __tmp.put_u8(self.autocontinue);
20072 if matches!(version, MavlinkVersion::V2) {
20073 __tmp.put_u8(self.mission_type as u8);
20074 let len = __tmp.len();
20075 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20076 } else {
20077 __tmp.len()
20078 }
20079 }
20080}
20081#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20082#[doc = ""]
20083#[doc = "ID: 46"]
20084#[derive(Debug, Clone, PartialEq)]
20085#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20087#[cfg_attr(feature = "ts", derive(TS))]
20088#[cfg_attr(feature = "ts", ts(export))]
20089pub struct MISSION_ITEM_REACHED_DATA {
20090 #[doc = "Sequence"]
20091 pub seq: u16,
20092}
20093impl MISSION_ITEM_REACHED_DATA {
20094 pub const ENCODED_LEN: usize = 2usize;
20095 pub const DEFAULT: Self = Self { seq: 0_u16 };
20096 #[cfg(feature = "arbitrary")]
20097 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20098 use arbitrary::{Arbitrary, Unstructured};
20099 let mut buf = [0u8; 1024];
20100 rng.fill_bytes(&mut buf);
20101 let mut unstructured = Unstructured::new(&buf);
20102 Self::arbitrary(&mut unstructured).unwrap_or_default()
20103 }
20104}
20105impl Default for MISSION_ITEM_REACHED_DATA {
20106 fn default() -> Self {
20107 Self::DEFAULT.clone()
20108 }
20109}
20110impl MessageData for MISSION_ITEM_REACHED_DATA {
20111 type Message = MavMessage;
20112 const ID: u32 = 46u32;
20113 const NAME: &'static str = "MISSION_ITEM_REACHED";
20114 const EXTRA_CRC: u8 = 11u8;
20115 const ENCODED_LEN: usize = 2usize;
20116 fn deser(
20117 _version: MavlinkVersion,
20118 __input: &[u8],
20119 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20120 let avail_len = __input.len();
20121 let mut payload_buf = [0; Self::ENCODED_LEN];
20122 let mut buf = if avail_len < Self::ENCODED_LEN {
20123 payload_buf[0..avail_len].copy_from_slice(__input);
20124 Bytes::new(&payload_buf)
20125 } else {
20126 Bytes::new(__input)
20127 };
20128 let mut __struct = Self::default();
20129 __struct.seq = buf.get_u16_le();
20130 Ok(__struct)
20131 }
20132 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20133 let mut __tmp = BytesMut::new(bytes);
20134 #[allow(clippy::absurd_extreme_comparisons)]
20135 #[allow(unused_comparisons)]
20136 if __tmp.remaining() < Self::ENCODED_LEN {
20137 panic!(
20138 "buffer is too small (need {} bytes, but got {})",
20139 Self::ENCODED_LEN,
20140 __tmp.remaining(),
20141 )
20142 }
20143 __tmp.put_u16_le(self.seq);
20144 if matches!(version, MavlinkVersion::V2) {
20145 let len = __tmp.len();
20146 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20147 } else {
20148 __tmp.len()
20149 }
20150 }
20151}
20152#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20153#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20154#[doc = ""]
20155#[doc = "ID: 40"]
20156#[derive(Debug, Clone, PartialEq)]
20157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20159#[cfg_attr(feature = "ts", derive(TS))]
20160#[cfg_attr(feature = "ts", ts(export))]
20161pub struct MISSION_REQUEST_DATA {
20162 #[doc = "Sequence"]
20163 pub seq: u16,
20164 #[doc = "System ID"]
20165 pub target_system: u8,
20166 #[doc = "Component ID"]
20167 pub target_component: u8,
20168 #[doc = "Mission type."]
20169 #[cfg_attr(feature = "serde", serde(default))]
20170 pub mission_type: MavMissionType,
20171}
20172impl MISSION_REQUEST_DATA {
20173 pub const ENCODED_LEN: usize = 5usize;
20174 pub const DEFAULT: Self = Self {
20175 seq: 0_u16,
20176 target_system: 0_u8,
20177 target_component: 0_u8,
20178 mission_type: MavMissionType::DEFAULT,
20179 };
20180 #[cfg(feature = "arbitrary")]
20181 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20182 use arbitrary::{Arbitrary, Unstructured};
20183 let mut buf = [0u8; 1024];
20184 rng.fill_bytes(&mut buf);
20185 let mut unstructured = Unstructured::new(&buf);
20186 Self::arbitrary(&mut unstructured).unwrap_or_default()
20187 }
20188}
20189impl Default for MISSION_REQUEST_DATA {
20190 fn default() -> Self {
20191 Self::DEFAULT.clone()
20192 }
20193}
20194impl MessageData for MISSION_REQUEST_DATA {
20195 type Message = MavMessage;
20196 const ID: u32 = 40u32;
20197 const NAME: &'static str = "MISSION_REQUEST";
20198 const EXTRA_CRC: u8 = 230u8;
20199 const ENCODED_LEN: usize = 5usize;
20200 fn deser(
20201 _version: MavlinkVersion,
20202 __input: &[u8],
20203 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20204 let avail_len = __input.len();
20205 let mut payload_buf = [0; Self::ENCODED_LEN];
20206 let mut buf = if avail_len < Self::ENCODED_LEN {
20207 payload_buf[0..avail_len].copy_from_slice(__input);
20208 Bytes::new(&payload_buf)
20209 } else {
20210 Bytes::new(__input)
20211 };
20212 let mut __struct = Self::default();
20213 __struct.seq = buf.get_u16_le();
20214 __struct.target_system = buf.get_u8();
20215 __struct.target_component = buf.get_u8();
20216 let tmp = buf.get_u8();
20217 __struct.mission_type =
20218 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20219 enum_type: "MavMissionType",
20220 value: tmp as u32,
20221 })?;
20222 Ok(__struct)
20223 }
20224 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20225 let mut __tmp = BytesMut::new(bytes);
20226 #[allow(clippy::absurd_extreme_comparisons)]
20227 #[allow(unused_comparisons)]
20228 if __tmp.remaining() < Self::ENCODED_LEN {
20229 panic!(
20230 "buffer is too small (need {} bytes, but got {})",
20231 Self::ENCODED_LEN,
20232 __tmp.remaining(),
20233 )
20234 }
20235 __tmp.put_u16_le(self.seq);
20236 __tmp.put_u8(self.target_system);
20237 __tmp.put_u8(self.target_component);
20238 if matches!(version, MavlinkVersion::V2) {
20239 __tmp.put_u8(self.mission_type as u8);
20240 let len = __tmp.len();
20241 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20242 } else {
20243 __tmp.len()
20244 }
20245 }
20246}
20247#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20248#[doc = ""]
20249#[doc = "ID: 51"]
20250#[derive(Debug, Clone, PartialEq)]
20251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20252#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20253#[cfg_attr(feature = "ts", derive(TS))]
20254#[cfg_attr(feature = "ts", ts(export))]
20255pub struct MISSION_REQUEST_INT_DATA {
20256 #[doc = "Sequence"]
20257 pub seq: u16,
20258 #[doc = "System ID"]
20259 pub target_system: u8,
20260 #[doc = "Component ID"]
20261 pub target_component: u8,
20262 #[doc = "Mission type."]
20263 #[cfg_attr(feature = "serde", serde(default))]
20264 pub mission_type: MavMissionType,
20265}
20266impl MISSION_REQUEST_INT_DATA {
20267 pub const ENCODED_LEN: usize = 5usize;
20268 pub const DEFAULT: Self = Self {
20269 seq: 0_u16,
20270 target_system: 0_u8,
20271 target_component: 0_u8,
20272 mission_type: MavMissionType::DEFAULT,
20273 };
20274 #[cfg(feature = "arbitrary")]
20275 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20276 use arbitrary::{Arbitrary, Unstructured};
20277 let mut buf = [0u8; 1024];
20278 rng.fill_bytes(&mut buf);
20279 let mut unstructured = Unstructured::new(&buf);
20280 Self::arbitrary(&mut unstructured).unwrap_or_default()
20281 }
20282}
20283impl Default for MISSION_REQUEST_INT_DATA {
20284 fn default() -> Self {
20285 Self::DEFAULT.clone()
20286 }
20287}
20288impl MessageData for MISSION_REQUEST_INT_DATA {
20289 type Message = MavMessage;
20290 const ID: u32 = 51u32;
20291 const NAME: &'static str = "MISSION_REQUEST_INT";
20292 const EXTRA_CRC: u8 = 196u8;
20293 const ENCODED_LEN: usize = 5usize;
20294 fn deser(
20295 _version: MavlinkVersion,
20296 __input: &[u8],
20297 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20298 let avail_len = __input.len();
20299 let mut payload_buf = [0; Self::ENCODED_LEN];
20300 let mut buf = if avail_len < Self::ENCODED_LEN {
20301 payload_buf[0..avail_len].copy_from_slice(__input);
20302 Bytes::new(&payload_buf)
20303 } else {
20304 Bytes::new(__input)
20305 };
20306 let mut __struct = Self::default();
20307 __struct.seq = buf.get_u16_le();
20308 __struct.target_system = buf.get_u8();
20309 __struct.target_component = buf.get_u8();
20310 let tmp = buf.get_u8();
20311 __struct.mission_type =
20312 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20313 enum_type: "MavMissionType",
20314 value: tmp as u32,
20315 })?;
20316 Ok(__struct)
20317 }
20318 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20319 let mut __tmp = BytesMut::new(bytes);
20320 #[allow(clippy::absurd_extreme_comparisons)]
20321 #[allow(unused_comparisons)]
20322 if __tmp.remaining() < Self::ENCODED_LEN {
20323 panic!(
20324 "buffer is too small (need {} bytes, but got {})",
20325 Self::ENCODED_LEN,
20326 __tmp.remaining(),
20327 )
20328 }
20329 __tmp.put_u16_le(self.seq);
20330 __tmp.put_u8(self.target_system);
20331 __tmp.put_u8(self.target_component);
20332 if matches!(version, MavlinkVersion::V2) {
20333 __tmp.put_u8(self.mission_type as u8);
20334 let len = __tmp.len();
20335 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20336 } else {
20337 __tmp.len()
20338 }
20339 }
20340}
20341#[doc = "Request the overall list of mission items from the system/component."]
20342#[doc = ""]
20343#[doc = "ID: 43"]
20344#[derive(Debug, Clone, PartialEq)]
20345#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20346#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20347#[cfg_attr(feature = "ts", derive(TS))]
20348#[cfg_attr(feature = "ts", ts(export))]
20349pub struct MISSION_REQUEST_LIST_DATA {
20350 #[doc = "System ID"]
20351 pub target_system: u8,
20352 #[doc = "Component ID"]
20353 pub target_component: u8,
20354 #[doc = "Mission type."]
20355 #[cfg_attr(feature = "serde", serde(default))]
20356 pub mission_type: MavMissionType,
20357}
20358impl MISSION_REQUEST_LIST_DATA {
20359 pub const ENCODED_LEN: usize = 3usize;
20360 pub const DEFAULT: Self = Self {
20361 target_system: 0_u8,
20362 target_component: 0_u8,
20363 mission_type: MavMissionType::DEFAULT,
20364 };
20365 #[cfg(feature = "arbitrary")]
20366 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20367 use arbitrary::{Arbitrary, Unstructured};
20368 let mut buf = [0u8; 1024];
20369 rng.fill_bytes(&mut buf);
20370 let mut unstructured = Unstructured::new(&buf);
20371 Self::arbitrary(&mut unstructured).unwrap_or_default()
20372 }
20373}
20374impl Default for MISSION_REQUEST_LIST_DATA {
20375 fn default() -> Self {
20376 Self::DEFAULT.clone()
20377 }
20378}
20379impl MessageData for MISSION_REQUEST_LIST_DATA {
20380 type Message = MavMessage;
20381 const ID: u32 = 43u32;
20382 const NAME: &'static str = "MISSION_REQUEST_LIST";
20383 const EXTRA_CRC: u8 = 132u8;
20384 const ENCODED_LEN: usize = 3usize;
20385 fn deser(
20386 _version: MavlinkVersion,
20387 __input: &[u8],
20388 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20389 let avail_len = __input.len();
20390 let mut payload_buf = [0; Self::ENCODED_LEN];
20391 let mut buf = if avail_len < Self::ENCODED_LEN {
20392 payload_buf[0..avail_len].copy_from_slice(__input);
20393 Bytes::new(&payload_buf)
20394 } else {
20395 Bytes::new(__input)
20396 };
20397 let mut __struct = Self::default();
20398 __struct.target_system = buf.get_u8();
20399 __struct.target_component = buf.get_u8();
20400 let tmp = buf.get_u8();
20401 __struct.mission_type =
20402 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20403 enum_type: "MavMissionType",
20404 value: tmp as u32,
20405 })?;
20406 Ok(__struct)
20407 }
20408 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20409 let mut __tmp = BytesMut::new(bytes);
20410 #[allow(clippy::absurd_extreme_comparisons)]
20411 #[allow(unused_comparisons)]
20412 if __tmp.remaining() < Self::ENCODED_LEN {
20413 panic!(
20414 "buffer is too small (need {} bytes, but got {})",
20415 Self::ENCODED_LEN,
20416 __tmp.remaining(),
20417 )
20418 }
20419 __tmp.put_u8(self.target_system);
20420 __tmp.put_u8(self.target_component);
20421 if matches!(version, MavlinkVersion::V2) {
20422 __tmp.put_u8(self.mission_type as u8);
20423 let len = __tmp.len();
20424 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20425 } else {
20426 __tmp.len()
20427 }
20428 }
20429}
20430#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20431#[doc = ""]
20432#[doc = "ID: 37"]
20433#[derive(Debug, Clone, PartialEq)]
20434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20436#[cfg_attr(feature = "ts", derive(TS))]
20437#[cfg_attr(feature = "ts", ts(export))]
20438pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20439 #[doc = "Start index"]
20440 pub start_index: i16,
20441 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20442 pub end_index: i16,
20443 #[doc = "System ID"]
20444 pub target_system: u8,
20445 #[doc = "Component ID"]
20446 pub target_component: u8,
20447 #[doc = "Mission type."]
20448 #[cfg_attr(feature = "serde", serde(default))]
20449 pub mission_type: MavMissionType,
20450}
20451impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20452 pub const ENCODED_LEN: usize = 7usize;
20453 pub const DEFAULT: Self = Self {
20454 start_index: 0_i16,
20455 end_index: 0_i16,
20456 target_system: 0_u8,
20457 target_component: 0_u8,
20458 mission_type: MavMissionType::DEFAULT,
20459 };
20460 #[cfg(feature = "arbitrary")]
20461 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20462 use arbitrary::{Arbitrary, Unstructured};
20463 let mut buf = [0u8; 1024];
20464 rng.fill_bytes(&mut buf);
20465 let mut unstructured = Unstructured::new(&buf);
20466 Self::arbitrary(&mut unstructured).unwrap_or_default()
20467 }
20468}
20469impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20470 fn default() -> Self {
20471 Self::DEFAULT.clone()
20472 }
20473}
20474impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20475 type Message = MavMessage;
20476 const ID: u32 = 37u32;
20477 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20478 const EXTRA_CRC: u8 = 212u8;
20479 const ENCODED_LEN: usize = 7usize;
20480 fn deser(
20481 _version: MavlinkVersion,
20482 __input: &[u8],
20483 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20484 let avail_len = __input.len();
20485 let mut payload_buf = [0; Self::ENCODED_LEN];
20486 let mut buf = if avail_len < Self::ENCODED_LEN {
20487 payload_buf[0..avail_len].copy_from_slice(__input);
20488 Bytes::new(&payload_buf)
20489 } else {
20490 Bytes::new(__input)
20491 };
20492 let mut __struct = Self::default();
20493 __struct.start_index = buf.get_i16_le();
20494 __struct.end_index = buf.get_i16_le();
20495 __struct.target_system = buf.get_u8();
20496 __struct.target_component = buf.get_u8();
20497 let tmp = buf.get_u8();
20498 __struct.mission_type =
20499 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20500 enum_type: "MavMissionType",
20501 value: tmp as u32,
20502 })?;
20503 Ok(__struct)
20504 }
20505 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20506 let mut __tmp = BytesMut::new(bytes);
20507 #[allow(clippy::absurd_extreme_comparisons)]
20508 #[allow(unused_comparisons)]
20509 if __tmp.remaining() < Self::ENCODED_LEN {
20510 panic!(
20511 "buffer is too small (need {} bytes, but got {})",
20512 Self::ENCODED_LEN,
20513 __tmp.remaining(),
20514 )
20515 }
20516 __tmp.put_i16_le(self.start_index);
20517 __tmp.put_i16_le(self.end_index);
20518 __tmp.put_u8(self.target_system);
20519 __tmp.put_u8(self.target_component);
20520 if matches!(version, MavlinkVersion::V2) {
20521 __tmp.put_u8(self.mission_type as u8);
20522 let len = __tmp.len();
20523 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20524 } else {
20525 __tmp.len()
20526 }
20527 }
20528}
20529#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20530#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20531#[doc = ""]
20532#[doc = "ID: 41"]
20533#[derive(Debug, Clone, PartialEq)]
20534#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20535#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20536#[cfg_attr(feature = "ts", derive(TS))]
20537#[cfg_attr(feature = "ts", ts(export))]
20538pub struct MISSION_SET_CURRENT_DATA {
20539 #[doc = "Sequence"]
20540 pub seq: u16,
20541 #[doc = "System ID"]
20542 pub target_system: u8,
20543 #[doc = "Component ID"]
20544 pub target_component: u8,
20545}
20546impl MISSION_SET_CURRENT_DATA {
20547 pub const ENCODED_LEN: usize = 4usize;
20548 pub const DEFAULT: Self = Self {
20549 seq: 0_u16,
20550 target_system: 0_u8,
20551 target_component: 0_u8,
20552 };
20553 #[cfg(feature = "arbitrary")]
20554 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20555 use arbitrary::{Arbitrary, Unstructured};
20556 let mut buf = [0u8; 1024];
20557 rng.fill_bytes(&mut buf);
20558 let mut unstructured = Unstructured::new(&buf);
20559 Self::arbitrary(&mut unstructured).unwrap_or_default()
20560 }
20561}
20562impl Default for MISSION_SET_CURRENT_DATA {
20563 fn default() -> Self {
20564 Self::DEFAULT.clone()
20565 }
20566}
20567impl MessageData for MISSION_SET_CURRENT_DATA {
20568 type Message = MavMessage;
20569 const ID: u32 = 41u32;
20570 const NAME: &'static str = "MISSION_SET_CURRENT";
20571 const EXTRA_CRC: u8 = 28u8;
20572 const ENCODED_LEN: usize = 4usize;
20573 fn deser(
20574 _version: MavlinkVersion,
20575 __input: &[u8],
20576 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20577 let avail_len = __input.len();
20578 let mut payload_buf = [0; Self::ENCODED_LEN];
20579 let mut buf = if avail_len < Self::ENCODED_LEN {
20580 payload_buf[0..avail_len].copy_from_slice(__input);
20581 Bytes::new(&payload_buf)
20582 } else {
20583 Bytes::new(__input)
20584 };
20585 let mut __struct = Self::default();
20586 __struct.seq = buf.get_u16_le();
20587 __struct.target_system = buf.get_u8();
20588 __struct.target_component = buf.get_u8();
20589 Ok(__struct)
20590 }
20591 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20592 let mut __tmp = BytesMut::new(bytes);
20593 #[allow(clippy::absurd_extreme_comparisons)]
20594 #[allow(unused_comparisons)]
20595 if __tmp.remaining() < Self::ENCODED_LEN {
20596 panic!(
20597 "buffer is too small (need {} bytes, but got {})",
20598 Self::ENCODED_LEN,
20599 __tmp.remaining(),
20600 )
20601 }
20602 __tmp.put_u16_le(self.seq);
20603 __tmp.put_u8(self.target_system);
20604 __tmp.put_u8(self.target_component);
20605 if matches!(version, MavlinkVersion::V2) {
20606 let len = __tmp.len();
20607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20608 } else {
20609 __tmp.len()
20610 }
20611 }
20612}
20613#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20614#[doc = ""]
20615#[doc = "ID: 38"]
20616#[derive(Debug, Clone, PartialEq)]
20617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20619#[cfg_attr(feature = "ts", derive(TS))]
20620#[cfg_attr(feature = "ts", ts(export))]
20621pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20622 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20623 pub start_index: i16,
20624 #[doc = "End index, equal or greater than start index."]
20625 pub end_index: i16,
20626 #[doc = "System ID"]
20627 pub target_system: u8,
20628 #[doc = "Component ID"]
20629 pub target_component: u8,
20630 #[doc = "Mission type."]
20631 #[cfg_attr(feature = "serde", serde(default))]
20632 pub mission_type: MavMissionType,
20633}
20634impl MISSION_WRITE_PARTIAL_LIST_DATA {
20635 pub const ENCODED_LEN: usize = 7usize;
20636 pub const DEFAULT: Self = Self {
20637 start_index: 0_i16,
20638 end_index: 0_i16,
20639 target_system: 0_u8,
20640 target_component: 0_u8,
20641 mission_type: MavMissionType::DEFAULT,
20642 };
20643 #[cfg(feature = "arbitrary")]
20644 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20645 use arbitrary::{Arbitrary, Unstructured};
20646 let mut buf = [0u8; 1024];
20647 rng.fill_bytes(&mut buf);
20648 let mut unstructured = Unstructured::new(&buf);
20649 Self::arbitrary(&mut unstructured).unwrap_or_default()
20650 }
20651}
20652impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20653 fn default() -> Self {
20654 Self::DEFAULT.clone()
20655 }
20656}
20657impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20658 type Message = MavMessage;
20659 const ID: u32 = 38u32;
20660 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20661 const EXTRA_CRC: u8 = 9u8;
20662 const ENCODED_LEN: usize = 7usize;
20663 fn deser(
20664 _version: MavlinkVersion,
20665 __input: &[u8],
20666 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20667 let avail_len = __input.len();
20668 let mut payload_buf = [0; Self::ENCODED_LEN];
20669 let mut buf = if avail_len < Self::ENCODED_LEN {
20670 payload_buf[0..avail_len].copy_from_slice(__input);
20671 Bytes::new(&payload_buf)
20672 } else {
20673 Bytes::new(__input)
20674 };
20675 let mut __struct = Self::default();
20676 __struct.start_index = buf.get_i16_le();
20677 __struct.end_index = buf.get_i16_le();
20678 __struct.target_system = buf.get_u8();
20679 __struct.target_component = buf.get_u8();
20680 let tmp = buf.get_u8();
20681 __struct.mission_type =
20682 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20683 enum_type: "MavMissionType",
20684 value: tmp as u32,
20685 })?;
20686 Ok(__struct)
20687 }
20688 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20689 let mut __tmp = BytesMut::new(bytes);
20690 #[allow(clippy::absurd_extreme_comparisons)]
20691 #[allow(unused_comparisons)]
20692 if __tmp.remaining() < Self::ENCODED_LEN {
20693 panic!(
20694 "buffer is too small (need {} bytes, but got {})",
20695 Self::ENCODED_LEN,
20696 __tmp.remaining(),
20697 )
20698 }
20699 __tmp.put_i16_le(self.start_index);
20700 __tmp.put_i16_le(self.end_index);
20701 __tmp.put_u8(self.target_system);
20702 __tmp.put_u8(self.target_component);
20703 if matches!(version, MavlinkVersion::V2) {
20704 __tmp.put_u8(self.mission_type as u8);
20705 let len = __tmp.len();
20706 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20707 } else {
20708 __tmp.len()
20709 }
20710 }
20711}
20712#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20713#[doc = "Orientation of a mount."]
20714#[doc = ""]
20715#[doc = "ID: 265"]
20716#[derive(Debug, Clone, PartialEq)]
20717#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20718#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20719#[cfg_attr(feature = "ts", derive(TS))]
20720#[cfg_attr(feature = "ts", ts(export))]
20721pub struct MOUNT_ORIENTATION_DATA {
20722 #[doc = "Timestamp (time since system boot)."]
20723 pub time_boot_ms: u32,
20724 #[doc = "Roll in global frame (set to NaN for invalid)."]
20725 pub roll: f32,
20726 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20727 pub pitch: f32,
20728 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20729 pub yaw: f32,
20730 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20731 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20732 pub yaw_absolute: f32,
20733}
20734impl MOUNT_ORIENTATION_DATA {
20735 pub const ENCODED_LEN: usize = 20usize;
20736 pub const DEFAULT: Self = Self {
20737 time_boot_ms: 0_u32,
20738 roll: 0.0_f32,
20739 pitch: 0.0_f32,
20740 yaw: 0.0_f32,
20741 yaw_absolute: 0.0_f32,
20742 };
20743 #[cfg(feature = "arbitrary")]
20744 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20745 use arbitrary::{Arbitrary, Unstructured};
20746 let mut buf = [0u8; 1024];
20747 rng.fill_bytes(&mut buf);
20748 let mut unstructured = Unstructured::new(&buf);
20749 Self::arbitrary(&mut unstructured).unwrap_or_default()
20750 }
20751}
20752impl Default for MOUNT_ORIENTATION_DATA {
20753 fn default() -> Self {
20754 Self::DEFAULT.clone()
20755 }
20756}
20757impl MessageData for MOUNT_ORIENTATION_DATA {
20758 type Message = MavMessage;
20759 const ID: u32 = 265u32;
20760 const NAME: &'static str = "MOUNT_ORIENTATION";
20761 const EXTRA_CRC: u8 = 26u8;
20762 const ENCODED_LEN: usize = 20usize;
20763 fn deser(
20764 _version: MavlinkVersion,
20765 __input: &[u8],
20766 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20767 let avail_len = __input.len();
20768 let mut payload_buf = [0; Self::ENCODED_LEN];
20769 let mut buf = if avail_len < Self::ENCODED_LEN {
20770 payload_buf[0..avail_len].copy_from_slice(__input);
20771 Bytes::new(&payload_buf)
20772 } else {
20773 Bytes::new(__input)
20774 };
20775 let mut __struct = Self::default();
20776 __struct.time_boot_ms = buf.get_u32_le();
20777 __struct.roll = buf.get_f32_le();
20778 __struct.pitch = buf.get_f32_le();
20779 __struct.yaw = buf.get_f32_le();
20780 __struct.yaw_absolute = buf.get_f32_le();
20781 Ok(__struct)
20782 }
20783 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20784 let mut __tmp = BytesMut::new(bytes);
20785 #[allow(clippy::absurd_extreme_comparisons)]
20786 #[allow(unused_comparisons)]
20787 if __tmp.remaining() < Self::ENCODED_LEN {
20788 panic!(
20789 "buffer is too small (need {} bytes, but got {})",
20790 Self::ENCODED_LEN,
20791 __tmp.remaining(),
20792 )
20793 }
20794 __tmp.put_u32_le(self.time_boot_ms);
20795 __tmp.put_f32_le(self.roll);
20796 __tmp.put_f32_le(self.pitch);
20797 __tmp.put_f32_le(self.yaw);
20798 if matches!(version, MavlinkVersion::V2) {
20799 __tmp.put_f32_le(self.yaw_absolute);
20800 let len = __tmp.len();
20801 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20802 } else {
20803 __tmp.len()
20804 }
20805 }
20806}
20807#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20808#[doc = ""]
20809#[doc = "ID: 251"]
20810#[derive(Debug, Clone, PartialEq)]
20811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20813#[cfg_attr(feature = "ts", derive(TS))]
20814#[cfg_attr(feature = "ts", ts(export))]
20815pub struct NAMED_VALUE_FLOAT_DATA {
20816 #[doc = "Timestamp (time since system boot)."]
20817 pub time_boot_ms: u32,
20818 #[doc = "Floating point value"]
20819 pub value: f32,
20820 #[doc = "Name of the debug variable"]
20821 #[cfg_attr(
20822 feature = "serde",
20823 serde(
20824 serialize_with = "crate::nulstr::serialize::<_, 10>",
20825 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
20826 )
20827 )]
20828 #[cfg_attr(feature = "ts", ts(type = "string"))]
20829 pub name: [u8; 10],
20830}
20831impl NAMED_VALUE_FLOAT_DATA {
20832 pub const ENCODED_LEN: usize = 18usize;
20833 pub const DEFAULT: Self = Self {
20834 time_boot_ms: 0_u32,
20835 value: 0.0_f32,
20836 name: [0_u8; 10usize],
20837 };
20838 #[cfg(feature = "arbitrary")]
20839 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20840 use arbitrary::{Arbitrary, Unstructured};
20841 let mut buf = [0u8; 1024];
20842 rng.fill_bytes(&mut buf);
20843 let mut unstructured = Unstructured::new(&buf);
20844 Self::arbitrary(&mut unstructured).unwrap_or_default()
20845 }
20846}
20847impl Default for NAMED_VALUE_FLOAT_DATA {
20848 fn default() -> Self {
20849 Self::DEFAULT.clone()
20850 }
20851}
20852impl MessageData for NAMED_VALUE_FLOAT_DATA {
20853 type Message = MavMessage;
20854 const ID: u32 = 251u32;
20855 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20856 const EXTRA_CRC: u8 = 170u8;
20857 const ENCODED_LEN: usize = 18usize;
20858 fn deser(
20859 _version: MavlinkVersion,
20860 __input: &[u8],
20861 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20862 let avail_len = __input.len();
20863 let mut payload_buf = [0; Self::ENCODED_LEN];
20864 let mut buf = if avail_len < Self::ENCODED_LEN {
20865 payload_buf[0..avail_len].copy_from_slice(__input);
20866 Bytes::new(&payload_buf)
20867 } else {
20868 Bytes::new(__input)
20869 };
20870 let mut __struct = Self::default();
20871 __struct.time_boot_ms = buf.get_u32_le();
20872 __struct.value = buf.get_f32_le();
20873 for v in &mut __struct.name {
20874 let val = buf.get_u8();
20875 *v = val;
20876 }
20877 Ok(__struct)
20878 }
20879 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20880 let mut __tmp = BytesMut::new(bytes);
20881 #[allow(clippy::absurd_extreme_comparisons)]
20882 #[allow(unused_comparisons)]
20883 if __tmp.remaining() < Self::ENCODED_LEN {
20884 panic!(
20885 "buffer is too small (need {} bytes, but got {})",
20886 Self::ENCODED_LEN,
20887 __tmp.remaining(),
20888 )
20889 }
20890 __tmp.put_u32_le(self.time_boot_ms);
20891 __tmp.put_f32_le(self.value);
20892 for val in &self.name {
20893 __tmp.put_u8(*val);
20894 }
20895 if matches!(version, MavlinkVersion::V2) {
20896 let len = __tmp.len();
20897 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20898 } else {
20899 __tmp.len()
20900 }
20901 }
20902}
20903#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20904#[doc = ""]
20905#[doc = "ID: 252"]
20906#[derive(Debug, Clone, PartialEq)]
20907#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20908#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20909#[cfg_attr(feature = "ts", derive(TS))]
20910#[cfg_attr(feature = "ts", ts(export))]
20911pub struct NAMED_VALUE_INT_DATA {
20912 #[doc = "Timestamp (time since system boot)."]
20913 pub time_boot_ms: u32,
20914 #[doc = "Signed integer value"]
20915 pub value: i32,
20916 #[doc = "Name of the debug variable"]
20917 #[cfg_attr(
20918 feature = "serde",
20919 serde(
20920 serialize_with = "crate::nulstr::serialize::<_, 10>",
20921 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
20922 )
20923 )]
20924 #[cfg_attr(feature = "ts", ts(type = "string"))]
20925 pub name: [u8; 10],
20926}
20927impl NAMED_VALUE_INT_DATA {
20928 pub const ENCODED_LEN: usize = 18usize;
20929 pub const DEFAULT: Self = Self {
20930 time_boot_ms: 0_u32,
20931 value: 0_i32,
20932 name: [0_u8; 10usize],
20933 };
20934 #[cfg(feature = "arbitrary")]
20935 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20936 use arbitrary::{Arbitrary, Unstructured};
20937 let mut buf = [0u8; 1024];
20938 rng.fill_bytes(&mut buf);
20939 let mut unstructured = Unstructured::new(&buf);
20940 Self::arbitrary(&mut unstructured).unwrap_or_default()
20941 }
20942}
20943impl Default for NAMED_VALUE_INT_DATA {
20944 fn default() -> Self {
20945 Self::DEFAULT.clone()
20946 }
20947}
20948impl MessageData for NAMED_VALUE_INT_DATA {
20949 type Message = MavMessage;
20950 const ID: u32 = 252u32;
20951 const NAME: &'static str = "NAMED_VALUE_INT";
20952 const EXTRA_CRC: u8 = 44u8;
20953 const ENCODED_LEN: usize = 18usize;
20954 fn deser(
20955 _version: MavlinkVersion,
20956 __input: &[u8],
20957 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20958 let avail_len = __input.len();
20959 let mut payload_buf = [0; Self::ENCODED_LEN];
20960 let mut buf = if avail_len < Self::ENCODED_LEN {
20961 payload_buf[0..avail_len].copy_from_slice(__input);
20962 Bytes::new(&payload_buf)
20963 } else {
20964 Bytes::new(__input)
20965 };
20966 let mut __struct = Self::default();
20967 __struct.time_boot_ms = buf.get_u32_le();
20968 __struct.value = buf.get_i32_le();
20969 for v in &mut __struct.name {
20970 let val = buf.get_u8();
20971 *v = val;
20972 }
20973 Ok(__struct)
20974 }
20975 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20976 let mut __tmp = BytesMut::new(bytes);
20977 #[allow(clippy::absurd_extreme_comparisons)]
20978 #[allow(unused_comparisons)]
20979 if __tmp.remaining() < Self::ENCODED_LEN {
20980 panic!(
20981 "buffer is too small (need {} bytes, but got {})",
20982 Self::ENCODED_LEN,
20983 __tmp.remaining(),
20984 )
20985 }
20986 __tmp.put_u32_le(self.time_boot_ms);
20987 __tmp.put_i32_le(self.value);
20988 for val in &self.name {
20989 __tmp.put_u8(*val);
20990 }
20991 if matches!(version, MavlinkVersion::V2) {
20992 let len = __tmp.len();
20993 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20994 } else {
20995 __tmp.len()
20996 }
20997 }
20998}
20999#[doc = "The state of the navigation and position controller."]
21000#[doc = ""]
21001#[doc = "ID: 62"]
21002#[derive(Debug, Clone, PartialEq)]
21003#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21004#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21005#[cfg_attr(feature = "ts", derive(TS))]
21006#[cfg_attr(feature = "ts", ts(export))]
21007pub struct NAV_CONTROLLER_OUTPUT_DATA {
21008 #[doc = "Current desired roll"]
21009 pub nav_roll: f32,
21010 #[doc = "Current desired pitch"]
21011 pub nav_pitch: f32,
21012 #[doc = "Current altitude error"]
21013 pub alt_error: f32,
21014 #[doc = "Current airspeed error"]
21015 pub aspd_error: f32,
21016 #[doc = "Current crosstrack error on x-y plane"]
21017 pub xtrack_error: f32,
21018 #[doc = "Current desired heading"]
21019 pub nav_bearing: i16,
21020 #[doc = "Bearing to current waypoint/target"]
21021 pub target_bearing: i16,
21022 #[doc = "Distance to active waypoint"]
21023 pub wp_dist: u16,
21024}
21025impl NAV_CONTROLLER_OUTPUT_DATA {
21026 pub const ENCODED_LEN: usize = 26usize;
21027 pub const DEFAULT: Self = Self {
21028 nav_roll: 0.0_f32,
21029 nav_pitch: 0.0_f32,
21030 alt_error: 0.0_f32,
21031 aspd_error: 0.0_f32,
21032 xtrack_error: 0.0_f32,
21033 nav_bearing: 0_i16,
21034 target_bearing: 0_i16,
21035 wp_dist: 0_u16,
21036 };
21037 #[cfg(feature = "arbitrary")]
21038 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21039 use arbitrary::{Arbitrary, Unstructured};
21040 let mut buf = [0u8; 1024];
21041 rng.fill_bytes(&mut buf);
21042 let mut unstructured = Unstructured::new(&buf);
21043 Self::arbitrary(&mut unstructured).unwrap_or_default()
21044 }
21045}
21046impl Default for NAV_CONTROLLER_OUTPUT_DATA {
21047 fn default() -> Self {
21048 Self::DEFAULT.clone()
21049 }
21050}
21051impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
21052 type Message = MavMessage;
21053 const ID: u32 = 62u32;
21054 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
21055 const EXTRA_CRC: u8 = 183u8;
21056 const ENCODED_LEN: usize = 26usize;
21057 fn deser(
21058 _version: MavlinkVersion,
21059 __input: &[u8],
21060 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21061 let avail_len = __input.len();
21062 let mut payload_buf = [0; Self::ENCODED_LEN];
21063 let mut buf = if avail_len < Self::ENCODED_LEN {
21064 payload_buf[0..avail_len].copy_from_slice(__input);
21065 Bytes::new(&payload_buf)
21066 } else {
21067 Bytes::new(__input)
21068 };
21069 let mut __struct = Self::default();
21070 __struct.nav_roll = buf.get_f32_le();
21071 __struct.nav_pitch = buf.get_f32_le();
21072 __struct.alt_error = buf.get_f32_le();
21073 __struct.aspd_error = buf.get_f32_le();
21074 __struct.xtrack_error = buf.get_f32_le();
21075 __struct.nav_bearing = buf.get_i16_le();
21076 __struct.target_bearing = buf.get_i16_le();
21077 __struct.wp_dist = buf.get_u16_le();
21078 Ok(__struct)
21079 }
21080 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21081 let mut __tmp = BytesMut::new(bytes);
21082 #[allow(clippy::absurd_extreme_comparisons)]
21083 #[allow(unused_comparisons)]
21084 if __tmp.remaining() < Self::ENCODED_LEN {
21085 panic!(
21086 "buffer is too small (need {} bytes, but got {})",
21087 Self::ENCODED_LEN,
21088 __tmp.remaining(),
21089 )
21090 }
21091 __tmp.put_f32_le(self.nav_roll);
21092 __tmp.put_f32_le(self.nav_pitch);
21093 __tmp.put_f32_le(self.alt_error);
21094 __tmp.put_f32_le(self.aspd_error);
21095 __tmp.put_f32_le(self.xtrack_error);
21096 __tmp.put_i16_le(self.nav_bearing);
21097 __tmp.put_i16_le(self.target_bearing);
21098 __tmp.put_u16_le(self.wp_dist);
21099 if matches!(version, MavlinkVersion::V2) {
21100 let len = __tmp.len();
21101 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21102 } else {
21103 __tmp.len()
21104 }
21105 }
21106}
21107#[doc = "Accelerometer and Gyro biases from the navigation filter."]
21108#[doc = ""]
21109#[doc = "ID: 220"]
21110#[derive(Debug, Clone, PartialEq)]
21111#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21113#[cfg_attr(feature = "ts", derive(TS))]
21114#[cfg_attr(feature = "ts", ts(export))]
21115pub struct NAV_FILTER_BIAS_DATA {
21116 #[doc = "Timestamp (microseconds)"]
21117 pub usec: u64,
21118 #[doc = "b_f[0]"]
21119 pub accel_0: f32,
21120 #[doc = "b_f[1]"]
21121 pub accel_1: f32,
21122 #[doc = "b_f[2]"]
21123 pub accel_2: f32,
21124 #[doc = "b_f[0]"]
21125 pub gyro_0: f32,
21126 #[doc = "b_f[1]"]
21127 pub gyro_1: f32,
21128 #[doc = "b_f[2]"]
21129 pub gyro_2: f32,
21130}
21131impl NAV_FILTER_BIAS_DATA {
21132 pub const ENCODED_LEN: usize = 32usize;
21133 pub const DEFAULT: Self = Self {
21134 usec: 0_u64,
21135 accel_0: 0.0_f32,
21136 accel_1: 0.0_f32,
21137 accel_2: 0.0_f32,
21138 gyro_0: 0.0_f32,
21139 gyro_1: 0.0_f32,
21140 gyro_2: 0.0_f32,
21141 };
21142 #[cfg(feature = "arbitrary")]
21143 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21144 use arbitrary::{Arbitrary, Unstructured};
21145 let mut buf = [0u8; 1024];
21146 rng.fill_bytes(&mut buf);
21147 let mut unstructured = Unstructured::new(&buf);
21148 Self::arbitrary(&mut unstructured).unwrap_or_default()
21149 }
21150}
21151impl Default for NAV_FILTER_BIAS_DATA {
21152 fn default() -> Self {
21153 Self::DEFAULT.clone()
21154 }
21155}
21156impl MessageData for NAV_FILTER_BIAS_DATA {
21157 type Message = MavMessage;
21158 const ID: u32 = 220u32;
21159 const NAME: &'static str = "NAV_FILTER_BIAS";
21160 const EXTRA_CRC: u8 = 34u8;
21161 const ENCODED_LEN: usize = 32usize;
21162 fn deser(
21163 _version: MavlinkVersion,
21164 __input: &[u8],
21165 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21166 let avail_len = __input.len();
21167 let mut payload_buf = [0; Self::ENCODED_LEN];
21168 let mut buf = if avail_len < Self::ENCODED_LEN {
21169 payload_buf[0..avail_len].copy_from_slice(__input);
21170 Bytes::new(&payload_buf)
21171 } else {
21172 Bytes::new(__input)
21173 };
21174 let mut __struct = Self::default();
21175 __struct.usec = buf.get_u64_le();
21176 __struct.accel_0 = buf.get_f32_le();
21177 __struct.accel_1 = buf.get_f32_le();
21178 __struct.accel_2 = buf.get_f32_le();
21179 __struct.gyro_0 = buf.get_f32_le();
21180 __struct.gyro_1 = buf.get_f32_le();
21181 __struct.gyro_2 = buf.get_f32_le();
21182 Ok(__struct)
21183 }
21184 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21185 let mut __tmp = BytesMut::new(bytes);
21186 #[allow(clippy::absurd_extreme_comparisons)]
21187 #[allow(unused_comparisons)]
21188 if __tmp.remaining() < Self::ENCODED_LEN {
21189 panic!(
21190 "buffer is too small (need {} bytes, but got {})",
21191 Self::ENCODED_LEN,
21192 __tmp.remaining(),
21193 )
21194 }
21195 __tmp.put_u64_le(self.usec);
21196 __tmp.put_f32_le(self.accel_0);
21197 __tmp.put_f32_le(self.accel_1);
21198 __tmp.put_f32_le(self.accel_2);
21199 __tmp.put_f32_le(self.gyro_0);
21200 __tmp.put_f32_le(self.gyro_1);
21201 __tmp.put_f32_le(self.gyro_2);
21202 if matches!(version, MavlinkVersion::V2) {
21203 let len = __tmp.len();
21204 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21205 } else {
21206 __tmp.len()
21207 }
21208 }
21209}
21210#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21211#[doc = ""]
21212#[doc = "ID: 330"]
21213#[derive(Debug, Clone, PartialEq)]
21214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21216#[cfg_attr(feature = "ts", derive(TS))]
21217#[cfg_attr(feature = "ts", ts(export))]
21218pub struct OBSTACLE_DISTANCE_DATA {
21219 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21220 pub time_usec: u64,
21221 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21222 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21223 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21224 pub distances: [u16; 72],
21225 #[doc = "Minimum distance the sensor can measure."]
21226 pub min_distance: u16,
21227 #[doc = "Maximum distance the sensor can measure."]
21228 pub max_distance: u16,
21229 #[doc = "Class id of the distance sensor type."]
21230 pub sensor_type: MavDistanceSensor,
21231 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21232 pub increment: u8,
21233 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21234 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21235 pub increment_f: f32,
21236 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21237 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21238 pub angle_offset: f32,
21239 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21240 #[cfg_attr(feature = "serde", serde(default))]
21241 pub frame: MavFrame,
21242}
21243impl OBSTACLE_DISTANCE_DATA {
21244 pub const ENCODED_LEN: usize = 167usize;
21245 pub const DEFAULT: Self = Self {
21246 time_usec: 0_u64,
21247 distances: [0_u16; 72usize],
21248 min_distance: 0_u16,
21249 max_distance: 0_u16,
21250 sensor_type: MavDistanceSensor::DEFAULT,
21251 increment: 0_u8,
21252 increment_f: 0.0_f32,
21253 angle_offset: 0.0_f32,
21254 frame: MavFrame::DEFAULT,
21255 };
21256 #[cfg(feature = "arbitrary")]
21257 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21258 use arbitrary::{Arbitrary, Unstructured};
21259 let mut buf = [0u8; 1024];
21260 rng.fill_bytes(&mut buf);
21261 let mut unstructured = Unstructured::new(&buf);
21262 Self::arbitrary(&mut unstructured).unwrap_or_default()
21263 }
21264}
21265impl Default for OBSTACLE_DISTANCE_DATA {
21266 fn default() -> Self {
21267 Self::DEFAULT.clone()
21268 }
21269}
21270impl MessageData for OBSTACLE_DISTANCE_DATA {
21271 type Message = MavMessage;
21272 const ID: u32 = 330u32;
21273 const NAME: &'static str = "OBSTACLE_DISTANCE";
21274 const EXTRA_CRC: u8 = 23u8;
21275 const ENCODED_LEN: usize = 167usize;
21276 fn deser(
21277 _version: MavlinkVersion,
21278 __input: &[u8],
21279 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21280 let avail_len = __input.len();
21281 let mut payload_buf = [0; Self::ENCODED_LEN];
21282 let mut buf = if avail_len < Self::ENCODED_LEN {
21283 payload_buf[0..avail_len].copy_from_slice(__input);
21284 Bytes::new(&payload_buf)
21285 } else {
21286 Bytes::new(__input)
21287 };
21288 let mut __struct = Self::default();
21289 __struct.time_usec = buf.get_u64_le();
21290 for v in &mut __struct.distances {
21291 let val = buf.get_u16_le();
21292 *v = val;
21293 }
21294 __struct.min_distance = buf.get_u16_le();
21295 __struct.max_distance = buf.get_u16_le();
21296 let tmp = buf.get_u8();
21297 __struct.sensor_type =
21298 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21299 enum_type: "MavDistanceSensor",
21300 value: tmp as u32,
21301 })?;
21302 __struct.increment = buf.get_u8();
21303 __struct.increment_f = buf.get_f32_le();
21304 __struct.angle_offset = buf.get_f32_le();
21305 let tmp = buf.get_u8();
21306 __struct.frame =
21307 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21308 enum_type: "MavFrame",
21309 value: tmp as u32,
21310 })?;
21311 Ok(__struct)
21312 }
21313 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21314 let mut __tmp = BytesMut::new(bytes);
21315 #[allow(clippy::absurd_extreme_comparisons)]
21316 #[allow(unused_comparisons)]
21317 if __tmp.remaining() < Self::ENCODED_LEN {
21318 panic!(
21319 "buffer is too small (need {} bytes, but got {})",
21320 Self::ENCODED_LEN,
21321 __tmp.remaining(),
21322 )
21323 }
21324 __tmp.put_u64_le(self.time_usec);
21325 for val in &self.distances {
21326 __tmp.put_u16_le(*val);
21327 }
21328 __tmp.put_u16_le(self.min_distance);
21329 __tmp.put_u16_le(self.max_distance);
21330 __tmp.put_u8(self.sensor_type as u8);
21331 __tmp.put_u8(self.increment);
21332 if matches!(version, MavlinkVersion::V2) {
21333 __tmp.put_f32_le(self.increment_f);
21334 __tmp.put_f32_le(self.angle_offset);
21335 __tmp.put_u8(self.frame as u8);
21336 let len = __tmp.len();
21337 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21338 } else {
21339 __tmp.len()
21340 }
21341 }
21342}
21343#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21344#[doc = ""]
21345#[doc = "ID: 331"]
21346#[derive(Debug, Clone, PartialEq)]
21347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21348#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21349#[cfg_attr(feature = "ts", derive(TS))]
21350#[cfg_attr(feature = "ts", ts(export))]
21351pub struct ODOMETRY_DATA {
21352 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21353 pub time_usec: u64,
21354 #[doc = "X Position"]
21355 pub x: f32,
21356 #[doc = "Y Position"]
21357 pub y: f32,
21358 #[doc = "Z Position"]
21359 pub z: f32,
21360 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21361 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21362 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21363 pub q: [f32; 4],
21364 #[doc = "X linear speed"]
21365 pub vx: f32,
21366 #[doc = "Y linear speed"]
21367 pub vy: f32,
21368 #[doc = "Z linear speed"]
21369 pub vz: f32,
21370 #[doc = "Roll angular speed"]
21371 pub rollspeed: f32,
21372 #[doc = "Pitch angular speed"]
21373 pub pitchspeed: f32,
21374 #[doc = "Yaw angular speed"]
21375 pub yawspeed: f32,
21376 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21377 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21378 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21379 pub pose_covariance: [f32; 21],
21380 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21381 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21382 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21383 pub velocity_covariance: [f32; 21],
21384 #[doc = "Coordinate frame of reference for the pose data."]
21385 pub frame_id: MavFrame,
21386 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21387 pub child_frame_id: MavFrame,
21388 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21389 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21390 pub reset_counter: u8,
21391 #[doc = "Type of estimator that is providing the odometry."]
21392 #[cfg_attr(feature = "serde", serde(default))]
21393 pub estimator_type: MavEstimatorType,
21394 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21395 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21396 pub quality: i8,
21397}
21398impl ODOMETRY_DATA {
21399 pub const ENCODED_LEN: usize = 233usize;
21400 pub const DEFAULT: Self = Self {
21401 time_usec: 0_u64,
21402 x: 0.0_f32,
21403 y: 0.0_f32,
21404 z: 0.0_f32,
21405 q: [0.0_f32; 4usize],
21406 vx: 0.0_f32,
21407 vy: 0.0_f32,
21408 vz: 0.0_f32,
21409 rollspeed: 0.0_f32,
21410 pitchspeed: 0.0_f32,
21411 yawspeed: 0.0_f32,
21412 pose_covariance: [0.0_f32; 21usize],
21413 velocity_covariance: [0.0_f32; 21usize],
21414 frame_id: MavFrame::DEFAULT,
21415 child_frame_id: MavFrame::DEFAULT,
21416 reset_counter: 0_u8,
21417 estimator_type: MavEstimatorType::DEFAULT,
21418 quality: 0_i8,
21419 };
21420 #[cfg(feature = "arbitrary")]
21421 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21422 use arbitrary::{Arbitrary, Unstructured};
21423 let mut buf = [0u8; 1024];
21424 rng.fill_bytes(&mut buf);
21425 let mut unstructured = Unstructured::new(&buf);
21426 Self::arbitrary(&mut unstructured).unwrap_or_default()
21427 }
21428}
21429impl Default for ODOMETRY_DATA {
21430 fn default() -> Self {
21431 Self::DEFAULT.clone()
21432 }
21433}
21434impl MessageData for ODOMETRY_DATA {
21435 type Message = MavMessage;
21436 const ID: u32 = 331u32;
21437 const NAME: &'static str = "ODOMETRY";
21438 const EXTRA_CRC: u8 = 91u8;
21439 const ENCODED_LEN: usize = 233usize;
21440 fn deser(
21441 _version: MavlinkVersion,
21442 __input: &[u8],
21443 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21444 let avail_len = __input.len();
21445 let mut payload_buf = [0; Self::ENCODED_LEN];
21446 let mut buf = if avail_len < Self::ENCODED_LEN {
21447 payload_buf[0..avail_len].copy_from_slice(__input);
21448 Bytes::new(&payload_buf)
21449 } else {
21450 Bytes::new(__input)
21451 };
21452 let mut __struct = Self::default();
21453 __struct.time_usec = buf.get_u64_le();
21454 __struct.x = buf.get_f32_le();
21455 __struct.y = buf.get_f32_le();
21456 __struct.z = buf.get_f32_le();
21457 for v in &mut __struct.q {
21458 let val = buf.get_f32_le();
21459 *v = val;
21460 }
21461 __struct.vx = buf.get_f32_le();
21462 __struct.vy = buf.get_f32_le();
21463 __struct.vz = buf.get_f32_le();
21464 __struct.rollspeed = buf.get_f32_le();
21465 __struct.pitchspeed = buf.get_f32_le();
21466 __struct.yawspeed = buf.get_f32_le();
21467 for v in &mut __struct.pose_covariance {
21468 let val = buf.get_f32_le();
21469 *v = val;
21470 }
21471 for v in &mut __struct.velocity_covariance {
21472 let val = buf.get_f32_le();
21473 *v = val;
21474 }
21475 let tmp = buf.get_u8();
21476 __struct.frame_id =
21477 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21478 enum_type: "MavFrame",
21479 value: tmp as u32,
21480 })?;
21481 let tmp = buf.get_u8();
21482 __struct.child_frame_id =
21483 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21484 enum_type: "MavFrame",
21485 value: tmp as u32,
21486 })?;
21487 __struct.reset_counter = buf.get_u8();
21488 let tmp = buf.get_u8();
21489 __struct.estimator_type =
21490 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21491 enum_type: "MavEstimatorType",
21492 value: tmp as u32,
21493 })?;
21494 __struct.quality = buf.get_i8();
21495 Ok(__struct)
21496 }
21497 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21498 let mut __tmp = BytesMut::new(bytes);
21499 #[allow(clippy::absurd_extreme_comparisons)]
21500 #[allow(unused_comparisons)]
21501 if __tmp.remaining() < Self::ENCODED_LEN {
21502 panic!(
21503 "buffer is too small (need {} bytes, but got {})",
21504 Self::ENCODED_LEN,
21505 __tmp.remaining(),
21506 )
21507 }
21508 __tmp.put_u64_le(self.time_usec);
21509 __tmp.put_f32_le(self.x);
21510 __tmp.put_f32_le(self.y);
21511 __tmp.put_f32_le(self.z);
21512 for val in &self.q {
21513 __tmp.put_f32_le(*val);
21514 }
21515 __tmp.put_f32_le(self.vx);
21516 __tmp.put_f32_le(self.vy);
21517 __tmp.put_f32_le(self.vz);
21518 __tmp.put_f32_le(self.rollspeed);
21519 __tmp.put_f32_le(self.pitchspeed);
21520 __tmp.put_f32_le(self.yawspeed);
21521 for val in &self.pose_covariance {
21522 __tmp.put_f32_le(*val);
21523 }
21524 for val in &self.velocity_covariance {
21525 __tmp.put_f32_le(*val);
21526 }
21527 __tmp.put_u8(self.frame_id as u8);
21528 __tmp.put_u8(self.child_frame_id as u8);
21529 if matches!(version, MavlinkVersion::V2) {
21530 __tmp.put_u8(self.reset_counter);
21531 __tmp.put_u8(self.estimator_type as u8);
21532 __tmp.put_i8(self.quality);
21533 let len = __tmp.len();
21534 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21535 } else {
21536 __tmp.len()
21537 }
21538 }
21539}
21540#[doc = "Hardware status sent by an onboard computer."]
21541#[doc = ""]
21542#[doc = "ID: 390"]
21543#[derive(Debug, Clone, PartialEq)]
21544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21545#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21546#[cfg_attr(feature = "ts", derive(TS))]
21547#[cfg_attr(feature = "ts", ts(export))]
21548pub struct ONBOARD_COMPUTER_STATUS_DATA {
21549 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21550 pub time_usec: u64,
21551 #[doc = "Time since system boot."]
21552 pub uptime: u32,
21553 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21554 pub ram_usage: u32,
21555 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21556 pub ram_total: u32,
21557 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21558 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21559 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21560 pub storage_type: [u32; 4],
21561 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21562 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21563 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21564 pub storage_usage: [u32; 4],
21565 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21566 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21567 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21568 pub storage_total: [u32; 4],
21569 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21570 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21571 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21572 pub link_type: [u32; 6],
21573 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21574 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21575 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21576 pub link_tx_rate: [u32; 6],
21577 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21578 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21579 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21580 pub link_rx_rate: [u32; 6],
21581 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21582 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21583 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21584 pub link_tx_max: [u32; 6],
21585 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21586 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21587 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21588 pub link_rx_max: [u32; 6],
21589 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21590 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21591 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21592 pub fan_speed: [i16; 4],
21593 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21594 pub mavtype: u8,
21595 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21596 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21597 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21598 pub cpu_cores: [u8; 8],
21599 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21600 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21601 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21602 pub cpu_combined: [u8; 10],
21603 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21604 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21605 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21606 pub gpu_cores: [u8; 4],
21607 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21608 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21609 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21610 pub gpu_combined: [u8; 10],
21611 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21612 pub temperature_board: i8,
21613 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21614 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21615 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21616 pub temperature_core: [i8; 8],
21617}
21618impl ONBOARD_COMPUTER_STATUS_DATA {
21619 pub const ENCODED_LEN: usize = 238usize;
21620 pub const DEFAULT: Self = Self {
21621 time_usec: 0_u64,
21622 uptime: 0_u32,
21623 ram_usage: 0_u32,
21624 ram_total: 0_u32,
21625 storage_type: [0_u32; 4usize],
21626 storage_usage: [0_u32; 4usize],
21627 storage_total: [0_u32; 4usize],
21628 link_type: [0_u32; 6usize],
21629 link_tx_rate: [0_u32; 6usize],
21630 link_rx_rate: [0_u32; 6usize],
21631 link_tx_max: [0_u32; 6usize],
21632 link_rx_max: [0_u32; 6usize],
21633 fan_speed: [0_i16; 4usize],
21634 mavtype: 0_u8,
21635 cpu_cores: [0_u8; 8usize],
21636 cpu_combined: [0_u8; 10usize],
21637 gpu_cores: [0_u8; 4usize],
21638 gpu_combined: [0_u8; 10usize],
21639 temperature_board: 0_i8,
21640 temperature_core: [0_i8; 8usize],
21641 };
21642 #[cfg(feature = "arbitrary")]
21643 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21644 use arbitrary::{Arbitrary, Unstructured};
21645 let mut buf = [0u8; 1024];
21646 rng.fill_bytes(&mut buf);
21647 let mut unstructured = Unstructured::new(&buf);
21648 Self::arbitrary(&mut unstructured).unwrap_or_default()
21649 }
21650}
21651impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21652 fn default() -> Self {
21653 Self::DEFAULT.clone()
21654 }
21655}
21656impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21657 type Message = MavMessage;
21658 const ID: u32 = 390u32;
21659 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21660 const EXTRA_CRC: u8 = 156u8;
21661 const ENCODED_LEN: usize = 238usize;
21662 fn deser(
21663 _version: MavlinkVersion,
21664 __input: &[u8],
21665 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21666 let avail_len = __input.len();
21667 let mut payload_buf = [0; Self::ENCODED_LEN];
21668 let mut buf = if avail_len < Self::ENCODED_LEN {
21669 payload_buf[0..avail_len].copy_from_slice(__input);
21670 Bytes::new(&payload_buf)
21671 } else {
21672 Bytes::new(__input)
21673 };
21674 let mut __struct = Self::default();
21675 __struct.time_usec = buf.get_u64_le();
21676 __struct.uptime = buf.get_u32_le();
21677 __struct.ram_usage = buf.get_u32_le();
21678 __struct.ram_total = buf.get_u32_le();
21679 for v in &mut __struct.storage_type {
21680 let val = buf.get_u32_le();
21681 *v = val;
21682 }
21683 for v in &mut __struct.storage_usage {
21684 let val = buf.get_u32_le();
21685 *v = val;
21686 }
21687 for v in &mut __struct.storage_total {
21688 let val = buf.get_u32_le();
21689 *v = val;
21690 }
21691 for v in &mut __struct.link_type {
21692 let val = buf.get_u32_le();
21693 *v = val;
21694 }
21695 for v in &mut __struct.link_tx_rate {
21696 let val = buf.get_u32_le();
21697 *v = val;
21698 }
21699 for v in &mut __struct.link_rx_rate {
21700 let val = buf.get_u32_le();
21701 *v = val;
21702 }
21703 for v in &mut __struct.link_tx_max {
21704 let val = buf.get_u32_le();
21705 *v = val;
21706 }
21707 for v in &mut __struct.link_rx_max {
21708 let val = buf.get_u32_le();
21709 *v = val;
21710 }
21711 for v in &mut __struct.fan_speed {
21712 let val = buf.get_i16_le();
21713 *v = val;
21714 }
21715 __struct.mavtype = buf.get_u8();
21716 for v in &mut __struct.cpu_cores {
21717 let val = buf.get_u8();
21718 *v = val;
21719 }
21720 for v in &mut __struct.cpu_combined {
21721 let val = buf.get_u8();
21722 *v = val;
21723 }
21724 for v in &mut __struct.gpu_cores {
21725 let val = buf.get_u8();
21726 *v = val;
21727 }
21728 for v in &mut __struct.gpu_combined {
21729 let val = buf.get_u8();
21730 *v = val;
21731 }
21732 __struct.temperature_board = buf.get_i8();
21733 for v in &mut __struct.temperature_core {
21734 let val = buf.get_i8();
21735 *v = val;
21736 }
21737 Ok(__struct)
21738 }
21739 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21740 let mut __tmp = BytesMut::new(bytes);
21741 #[allow(clippy::absurd_extreme_comparisons)]
21742 #[allow(unused_comparisons)]
21743 if __tmp.remaining() < Self::ENCODED_LEN {
21744 panic!(
21745 "buffer is too small (need {} bytes, but got {})",
21746 Self::ENCODED_LEN,
21747 __tmp.remaining(),
21748 )
21749 }
21750 __tmp.put_u64_le(self.time_usec);
21751 __tmp.put_u32_le(self.uptime);
21752 __tmp.put_u32_le(self.ram_usage);
21753 __tmp.put_u32_le(self.ram_total);
21754 for val in &self.storage_type {
21755 __tmp.put_u32_le(*val);
21756 }
21757 for val in &self.storage_usage {
21758 __tmp.put_u32_le(*val);
21759 }
21760 for val in &self.storage_total {
21761 __tmp.put_u32_le(*val);
21762 }
21763 for val in &self.link_type {
21764 __tmp.put_u32_le(*val);
21765 }
21766 for val in &self.link_tx_rate {
21767 __tmp.put_u32_le(*val);
21768 }
21769 for val in &self.link_rx_rate {
21770 __tmp.put_u32_le(*val);
21771 }
21772 for val in &self.link_tx_max {
21773 __tmp.put_u32_le(*val);
21774 }
21775 for val in &self.link_rx_max {
21776 __tmp.put_u32_le(*val);
21777 }
21778 for val in &self.fan_speed {
21779 __tmp.put_i16_le(*val);
21780 }
21781 __tmp.put_u8(self.mavtype);
21782 for val in &self.cpu_cores {
21783 __tmp.put_u8(*val);
21784 }
21785 for val in &self.cpu_combined {
21786 __tmp.put_u8(*val);
21787 }
21788 for val in &self.gpu_cores {
21789 __tmp.put_u8(*val);
21790 }
21791 for val in &self.gpu_combined {
21792 __tmp.put_u8(*val);
21793 }
21794 __tmp.put_i8(self.temperature_board);
21795 for val in &self.temperature_core {
21796 __tmp.put_i8(*val);
21797 }
21798 if matches!(version, MavlinkVersion::V2) {
21799 let len = __tmp.len();
21800 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21801 } else {
21802 __tmp.len()
21803 }
21804 }
21805}
21806#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21807#[doc = ""]
21808#[doc = "ID: 12918"]
21809#[derive(Debug, Clone, PartialEq)]
21810#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21811#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21812#[cfg_attr(feature = "ts", derive(TS))]
21813#[cfg_attr(feature = "ts", ts(export))]
21814pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21815 #[doc = "Status level indicating if arming is allowed."]
21816 pub status: MavOdidArmStatus,
21817 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21818 #[cfg_attr(
21819 feature = "serde",
21820 serde(
21821 serialize_with = "crate::nulstr::serialize::<_, 50>",
21822 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
21823 )
21824 )]
21825 #[cfg_attr(feature = "ts", ts(type = "string"))]
21826 pub error: [u8; 50],
21827}
21828impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21829 pub const ENCODED_LEN: usize = 51usize;
21830 pub const DEFAULT: Self = Self {
21831 status: MavOdidArmStatus::DEFAULT,
21832 error: [0_u8; 50usize],
21833 };
21834 #[cfg(feature = "arbitrary")]
21835 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21836 use arbitrary::{Arbitrary, Unstructured};
21837 let mut buf = [0u8; 1024];
21838 rng.fill_bytes(&mut buf);
21839 let mut unstructured = Unstructured::new(&buf);
21840 Self::arbitrary(&mut unstructured).unwrap_or_default()
21841 }
21842}
21843impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21844 fn default() -> Self {
21845 Self::DEFAULT.clone()
21846 }
21847}
21848impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21849 type Message = MavMessage;
21850 const ID: u32 = 12918u32;
21851 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21852 const EXTRA_CRC: u8 = 139u8;
21853 const ENCODED_LEN: usize = 51usize;
21854 fn deser(
21855 _version: MavlinkVersion,
21856 __input: &[u8],
21857 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21858 let avail_len = __input.len();
21859 let mut payload_buf = [0; Self::ENCODED_LEN];
21860 let mut buf = if avail_len < Self::ENCODED_LEN {
21861 payload_buf[0..avail_len].copy_from_slice(__input);
21862 Bytes::new(&payload_buf)
21863 } else {
21864 Bytes::new(__input)
21865 };
21866 let mut __struct = Self::default();
21867 let tmp = buf.get_u8();
21868 __struct.status =
21869 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21870 enum_type: "MavOdidArmStatus",
21871 value: tmp as u32,
21872 })?;
21873 for v in &mut __struct.error {
21874 let val = buf.get_u8();
21875 *v = val;
21876 }
21877 Ok(__struct)
21878 }
21879 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21880 let mut __tmp = BytesMut::new(bytes);
21881 #[allow(clippy::absurd_extreme_comparisons)]
21882 #[allow(unused_comparisons)]
21883 if __tmp.remaining() < Self::ENCODED_LEN {
21884 panic!(
21885 "buffer is too small (need {} bytes, but got {})",
21886 Self::ENCODED_LEN,
21887 __tmp.remaining(),
21888 )
21889 }
21890 __tmp.put_u8(self.status as u8);
21891 for val in &self.error {
21892 __tmp.put_u8(*val);
21893 }
21894 if matches!(version, MavlinkVersion::V2) {
21895 let len = __tmp.len();
21896 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21897 } else {
21898 __tmp.len()
21899 }
21900 }
21901}
21902#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
21903#[doc = ""]
21904#[doc = "ID: 12902"]
21905#[derive(Debug, Clone, PartialEq)]
21906#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21907#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21908#[cfg_attr(feature = "ts", derive(TS))]
21909#[cfg_attr(feature = "ts", ts(export))]
21910pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21911 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21912 pub timestamp: u32,
21913 #[doc = "System ID (0 for broadcast)."]
21914 pub target_system: u8,
21915 #[doc = "Component ID (0 for broadcast)."]
21916 pub target_component: u8,
21917 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21918 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21919 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21920 pub id_or_mac: [u8; 20],
21921 #[doc = "Indicates the type of authentication."]
21922 pub authentication_type: MavOdidAuthType,
21923 #[doc = "Allowed range is 0 - 15."]
21924 pub data_page: u8,
21925 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21926 pub last_page_index: u8,
21927 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21928 pub length: u8,
21929 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21930 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21931 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21932 pub authentication_data: [u8; 23],
21933}
21934impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21935 pub const ENCODED_LEN: usize = 53usize;
21936 pub const DEFAULT: Self = Self {
21937 timestamp: 0_u32,
21938 target_system: 0_u8,
21939 target_component: 0_u8,
21940 id_or_mac: [0_u8; 20usize],
21941 authentication_type: MavOdidAuthType::DEFAULT,
21942 data_page: 0_u8,
21943 last_page_index: 0_u8,
21944 length: 0_u8,
21945 authentication_data: [0_u8; 23usize],
21946 };
21947 #[cfg(feature = "arbitrary")]
21948 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21949 use arbitrary::{Arbitrary, Unstructured};
21950 let mut buf = [0u8; 1024];
21951 rng.fill_bytes(&mut buf);
21952 let mut unstructured = Unstructured::new(&buf);
21953 Self::arbitrary(&mut unstructured).unwrap_or_default()
21954 }
21955}
21956impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21957 fn default() -> Self {
21958 Self::DEFAULT.clone()
21959 }
21960}
21961impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21962 type Message = MavMessage;
21963 const ID: u32 = 12902u32;
21964 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21965 const EXTRA_CRC: u8 = 140u8;
21966 const ENCODED_LEN: usize = 53usize;
21967 fn deser(
21968 _version: MavlinkVersion,
21969 __input: &[u8],
21970 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21971 let avail_len = __input.len();
21972 let mut payload_buf = [0; Self::ENCODED_LEN];
21973 let mut buf = if avail_len < Self::ENCODED_LEN {
21974 payload_buf[0..avail_len].copy_from_slice(__input);
21975 Bytes::new(&payload_buf)
21976 } else {
21977 Bytes::new(__input)
21978 };
21979 let mut __struct = Self::default();
21980 __struct.timestamp = buf.get_u32_le();
21981 __struct.target_system = buf.get_u8();
21982 __struct.target_component = buf.get_u8();
21983 for v in &mut __struct.id_or_mac {
21984 let val = buf.get_u8();
21985 *v = val;
21986 }
21987 let tmp = buf.get_u8();
21988 __struct.authentication_type =
21989 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21990 enum_type: "MavOdidAuthType",
21991 value: tmp as u32,
21992 })?;
21993 __struct.data_page = buf.get_u8();
21994 __struct.last_page_index = buf.get_u8();
21995 __struct.length = buf.get_u8();
21996 for v in &mut __struct.authentication_data {
21997 let val = buf.get_u8();
21998 *v = val;
21999 }
22000 Ok(__struct)
22001 }
22002 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22003 let mut __tmp = BytesMut::new(bytes);
22004 #[allow(clippy::absurd_extreme_comparisons)]
22005 #[allow(unused_comparisons)]
22006 if __tmp.remaining() < Self::ENCODED_LEN {
22007 panic!(
22008 "buffer is too small (need {} bytes, but got {})",
22009 Self::ENCODED_LEN,
22010 __tmp.remaining(),
22011 )
22012 }
22013 __tmp.put_u32_le(self.timestamp);
22014 __tmp.put_u8(self.target_system);
22015 __tmp.put_u8(self.target_component);
22016 for val in &self.id_or_mac {
22017 __tmp.put_u8(*val);
22018 }
22019 __tmp.put_u8(self.authentication_type as u8);
22020 __tmp.put_u8(self.data_page);
22021 __tmp.put_u8(self.last_page_index);
22022 __tmp.put_u8(self.length);
22023 for val in &self.authentication_data {
22024 __tmp.put_u8(*val);
22025 }
22026 if matches!(version, MavlinkVersion::V2) {
22027 let len = __tmp.len();
22028 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22029 } else {
22030 __tmp.len()
22031 }
22032 }
22033}
22034#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
22035#[doc = ""]
22036#[doc = "ID: 12900"]
22037#[derive(Debug, Clone, PartialEq)]
22038#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22040#[cfg_attr(feature = "ts", derive(TS))]
22041#[cfg_attr(feature = "ts", ts(export))]
22042pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
22043 #[doc = "System ID (0 for broadcast)."]
22044 pub target_system: u8,
22045 #[doc = "Component ID (0 for broadcast)."]
22046 pub target_component: u8,
22047 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22048 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22049 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22050 pub id_or_mac: [u8; 20],
22051 #[doc = "Indicates the format for the uas_id field of this message."]
22052 pub id_type: MavOdidIdType,
22053 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
22054 pub ua_type: MavOdidUaType,
22055 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
22056 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22057 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22058 pub uas_id: [u8; 20],
22059}
22060impl OPEN_DRONE_ID_BASIC_ID_DATA {
22061 pub const ENCODED_LEN: usize = 44usize;
22062 pub const DEFAULT: Self = Self {
22063 target_system: 0_u8,
22064 target_component: 0_u8,
22065 id_or_mac: [0_u8; 20usize],
22066 id_type: MavOdidIdType::DEFAULT,
22067 ua_type: MavOdidUaType::DEFAULT,
22068 uas_id: [0_u8; 20usize],
22069 };
22070 #[cfg(feature = "arbitrary")]
22071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22072 use arbitrary::{Arbitrary, Unstructured};
22073 let mut buf = [0u8; 1024];
22074 rng.fill_bytes(&mut buf);
22075 let mut unstructured = Unstructured::new(&buf);
22076 Self::arbitrary(&mut unstructured).unwrap_or_default()
22077 }
22078}
22079impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
22080 fn default() -> Self {
22081 Self::DEFAULT.clone()
22082 }
22083}
22084impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
22085 type Message = MavMessage;
22086 const ID: u32 = 12900u32;
22087 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
22088 const EXTRA_CRC: u8 = 114u8;
22089 const ENCODED_LEN: usize = 44usize;
22090 fn deser(
22091 _version: MavlinkVersion,
22092 __input: &[u8],
22093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22094 let avail_len = __input.len();
22095 let mut payload_buf = [0; Self::ENCODED_LEN];
22096 let mut buf = if avail_len < Self::ENCODED_LEN {
22097 payload_buf[0..avail_len].copy_from_slice(__input);
22098 Bytes::new(&payload_buf)
22099 } else {
22100 Bytes::new(__input)
22101 };
22102 let mut __struct = Self::default();
22103 __struct.target_system = buf.get_u8();
22104 __struct.target_component = buf.get_u8();
22105 for v in &mut __struct.id_or_mac {
22106 let val = buf.get_u8();
22107 *v = val;
22108 }
22109 let tmp = buf.get_u8();
22110 __struct.id_type =
22111 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22112 enum_type: "MavOdidIdType",
22113 value: tmp as u32,
22114 })?;
22115 let tmp = buf.get_u8();
22116 __struct.ua_type =
22117 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22118 enum_type: "MavOdidUaType",
22119 value: tmp as u32,
22120 })?;
22121 for v in &mut __struct.uas_id {
22122 let val = buf.get_u8();
22123 *v = val;
22124 }
22125 Ok(__struct)
22126 }
22127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22128 let mut __tmp = BytesMut::new(bytes);
22129 #[allow(clippy::absurd_extreme_comparisons)]
22130 #[allow(unused_comparisons)]
22131 if __tmp.remaining() < Self::ENCODED_LEN {
22132 panic!(
22133 "buffer is too small (need {} bytes, but got {})",
22134 Self::ENCODED_LEN,
22135 __tmp.remaining(),
22136 )
22137 }
22138 __tmp.put_u8(self.target_system);
22139 __tmp.put_u8(self.target_component);
22140 for val in &self.id_or_mac {
22141 __tmp.put_u8(*val);
22142 }
22143 __tmp.put_u8(self.id_type as u8);
22144 __tmp.put_u8(self.ua_type as u8);
22145 for val in &self.uas_id {
22146 __tmp.put_u8(*val);
22147 }
22148 if matches!(version, MavlinkVersion::V2) {
22149 let len = __tmp.len();
22150 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22151 } else {
22152 __tmp.len()
22153 }
22154 }
22155}
22156#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22157#[doc = ""]
22158#[doc = "ID: 12901"]
22159#[derive(Debug, Clone, PartialEq)]
22160#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22161#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22162#[cfg_attr(feature = "ts", derive(TS))]
22163#[cfg_attr(feature = "ts", ts(export))]
22164pub struct OPEN_DRONE_ID_LOCATION_DATA {
22165 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22166 pub latitude: i32,
22167 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22168 pub longitude: i32,
22169 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22170 pub altitude_barometric: f32,
22171 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22172 pub altitude_geodetic: f32,
22173 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22174 pub height: f32,
22175 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22176 pub timestamp: f32,
22177 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22178 pub direction: u16,
22179 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22180 pub speed_horizontal: u16,
22181 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22182 pub speed_vertical: i16,
22183 #[doc = "System ID (0 for broadcast)."]
22184 pub target_system: u8,
22185 #[doc = "Component ID (0 for broadcast)."]
22186 pub target_component: u8,
22187 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22188 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22189 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22190 pub id_or_mac: [u8; 20],
22191 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22192 pub status: MavOdidStatus,
22193 #[doc = "Indicates the reference point for the height field."]
22194 pub height_reference: MavOdidHeightRef,
22195 #[doc = "The accuracy of the horizontal position."]
22196 pub horizontal_accuracy: MavOdidHorAcc,
22197 #[doc = "The accuracy of the vertical position."]
22198 pub vertical_accuracy: MavOdidVerAcc,
22199 #[doc = "The accuracy of the barometric altitude."]
22200 pub barometer_accuracy: MavOdidVerAcc,
22201 #[doc = "The accuracy of the horizontal and vertical speed."]
22202 pub speed_accuracy: MavOdidSpeedAcc,
22203 #[doc = "The accuracy of the timestamps."]
22204 pub timestamp_accuracy: MavOdidTimeAcc,
22205}
22206impl OPEN_DRONE_ID_LOCATION_DATA {
22207 pub const ENCODED_LEN: usize = 59usize;
22208 pub const DEFAULT: Self = Self {
22209 latitude: 0_i32,
22210 longitude: 0_i32,
22211 altitude_barometric: 0.0_f32,
22212 altitude_geodetic: 0.0_f32,
22213 height: 0.0_f32,
22214 timestamp: 0.0_f32,
22215 direction: 0_u16,
22216 speed_horizontal: 0_u16,
22217 speed_vertical: 0_i16,
22218 target_system: 0_u8,
22219 target_component: 0_u8,
22220 id_or_mac: [0_u8; 20usize],
22221 status: MavOdidStatus::DEFAULT,
22222 height_reference: MavOdidHeightRef::DEFAULT,
22223 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22224 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22225 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22226 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22227 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22228 };
22229 #[cfg(feature = "arbitrary")]
22230 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22231 use arbitrary::{Arbitrary, Unstructured};
22232 let mut buf = [0u8; 1024];
22233 rng.fill_bytes(&mut buf);
22234 let mut unstructured = Unstructured::new(&buf);
22235 Self::arbitrary(&mut unstructured).unwrap_or_default()
22236 }
22237}
22238impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22239 fn default() -> Self {
22240 Self::DEFAULT.clone()
22241 }
22242}
22243impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22244 type Message = MavMessage;
22245 const ID: u32 = 12901u32;
22246 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22247 const EXTRA_CRC: u8 = 254u8;
22248 const ENCODED_LEN: usize = 59usize;
22249 fn deser(
22250 _version: MavlinkVersion,
22251 __input: &[u8],
22252 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22253 let avail_len = __input.len();
22254 let mut payload_buf = [0; Self::ENCODED_LEN];
22255 let mut buf = if avail_len < Self::ENCODED_LEN {
22256 payload_buf[0..avail_len].copy_from_slice(__input);
22257 Bytes::new(&payload_buf)
22258 } else {
22259 Bytes::new(__input)
22260 };
22261 let mut __struct = Self::default();
22262 __struct.latitude = buf.get_i32_le();
22263 __struct.longitude = buf.get_i32_le();
22264 __struct.altitude_barometric = buf.get_f32_le();
22265 __struct.altitude_geodetic = buf.get_f32_le();
22266 __struct.height = buf.get_f32_le();
22267 __struct.timestamp = buf.get_f32_le();
22268 __struct.direction = buf.get_u16_le();
22269 __struct.speed_horizontal = buf.get_u16_le();
22270 __struct.speed_vertical = buf.get_i16_le();
22271 __struct.target_system = buf.get_u8();
22272 __struct.target_component = buf.get_u8();
22273 for v in &mut __struct.id_or_mac {
22274 let val = buf.get_u8();
22275 *v = val;
22276 }
22277 let tmp = buf.get_u8();
22278 __struct.status =
22279 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22280 enum_type: "MavOdidStatus",
22281 value: tmp as u32,
22282 })?;
22283 let tmp = buf.get_u8();
22284 __struct.height_reference =
22285 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22286 enum_type: "MavOdidHeightRef",
22287 value: tmp as u32,
22288 })?;
22289 let tmp = buf.get_u8();
22290 __struct.horizontal_accuracy =
22291 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22292 enum_type: "MavOdidHorAcc",
22293 value: tmp as u32,
22294 })?;
22295 let tmp = buf.get_u8();
22296 __struct.vertical_accuracy =
22297 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22298 enum_type: "MavOdidVerAcc",
22299 value: tmp as u32,
22300 })?;
22301 let tmp = buf.get_u8();
22302 __struct.barometer_accuracy =
22303 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22304 enum_type: "MavOdidVerAcc",
22305 value: tmp as u32,
22306 })?;
22307 let tmp = buf.get_u8();
22308 __struct.speed_accuracy =
22309 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22310 enum_type: "MavOdidSpeedAcc",
22311 value: tmp as u32,
22312 })?;
22313 let tmp = buf.get_u8();
22314 __struct.timestamp_accuracy =
22315 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22316 enum_type: "MavOdidTimeAcc",
22317 value: tmp as u32,
22318 })?;
22319 Ok(__struct)
22320 }
22321 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22322 let mut __tmp = BytesMut::new(bytes);
22323 #[allow(clippy::absurd_extreme_comparisons)]
22324 #[allow(unused_comparisons)]
22325 if __tmp.remaining() < Self::ENCODED_LEN {
22326 panic!(
22327 "buffer is too small (need {} bytes, but got {})",
22328 Self::ENCODED_LEN,
22329 __tmp.remaining(),
22330 )
22331 }
22332 __tmp.put_i32_le(self.latitude);
22333 __tmp.put_i32_le(self.longitude);
22334 __tmp.put_f32_le(self.altitude_barometric);
22335 __tmp.put_f32_le(self.altitude_geodetic);
22336 __tmp.put_f32_le(self.height);
22337 __tmp.put_f32_le(self.timestamp);
22338 __tmp.put_u16_le(self.direction);
22339 __tmp.put_u16_le(self.speed_horizontal);
22340 __tmp.put_i16_le(self.speed_vertical);
22341 __tmp.put_u8(self.target_system);
22342 __tmp.put_u8(self.target_component);
22343 for val in &self.id_or_mac {
22344 __tmp.put_u8(*val);
22345 }
22346 __tmp.put_u8(self.status as u8);
22347 __tmp.put_u8(self.height_reference as u8);
22348 __tmp.put_u8(self.horizontal_accuracy as u8);
22349 __tmp.put_u8(self.vertical_accuracy as u8);
22350 __tmp.put_u8(self.barometer_accuracy as u8);
22351 __tmp.put_u8(self.speed_accuracy as u8);
22352 __tmp.put_u8(self.timestamp_accuracy as u8);
22353 if matches!(version, MavlinkVersion::V2) {
22354 let len = __tmp.len();
22355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22356 } else {
22357 __tmp.len()
22358 }
22359 }
22360}
22361#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22362#[doc = ""]
22363#[doc = "ID: 12915"]
22364#[derive(Debug, Clone, PartialEq)]
22365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22367#[cfg_attr(feature = "ts", derive(TS))]
22368#[cfg_attr(feature = "ts", ts(export))]
22369pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22370 #[doc = "System ID (0 for broadcast)."]
22371 pub target_system: u8,
22372 #[doc = "Component ID (0 for broadcast)."]
22373 pub target_component: u8,
22374 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22375 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22376 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22377 pub id_or_mac: [u8; 20],
22378 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22379 pub single_message_size: u8,
22380 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22381 pub msg_pack_size: u8,
22382 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22383 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22384 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22385 pub messages: [u8; 225],
22386}
22387impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22388 pub const ENCODED_LEN: usize = 249usize;
22389 pub const DEFAULT: Self = Self {
22390 target_system: 0_u8,
22391 target_component: 0_u8,
22392 id_or_mac: [0_u8; 20usize],
22393 single_message_size: 0_u8,
22394 msg_pack_size: 0_u8,
22395 messages: [0_u8; 225usize],
22396 };
22397 #[cfg(feature = "arbitrary")]
22398 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22399 use arbitrary::{Arbitrary, Unstructured};
22400 let mut buf = [0u8; 1024];
22401 rng.fill_bytes(&mut buf);
22402 let mut unstructured = Unstructured::new(&buf);
22403 Self::arbitrary(&mut unstructured).unwrap_or_default()
22404 }
22405}
22406impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22407 fn default() -> Self {
22408 Self::DEFAULT.clone()
22409 }
22410}
22411impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22412 type Message = MavMessage;
22413 const ID: u32 = 12915u32;
22414 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22415 const EXTRA_CRC: u8 = 94u8;
22416 const ENCODED_LEN: usize = 249usize;
22417 fn deser(
22418 _version: MavlinkVersion,
22419 __input: &[u8],
22420 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22421 let avail_len = __input.len();
22422 let mut payload_buf = [0; Self::ENCODED_LEN];
22423 let mut buf = if avail_len < Self::ENCODED_LEN {
22424 payload_buf[0..avail_len].copy_from_slice(__input);
22425 Bytes::new(&payload_buf)
22426 } else {
22427 Bytes::new(__input)
22428 };
22429 let mut __struct = Self::default();
22430 __struct.target_system = buf.get_u8();
22431 __struct.target_component = buf.get_u8();
22432 for v in &mut __struct.id_or_mac {
22433 let val = buf.get_u8();
22434 *v = val;
22435 }
22436 __struct.single_message_size = buf.get_u8();
22437 __struct.msg_pack_size = buf.get_u8();
22438 for v in &mut __struct.messages {
22439 let val = buf.get_u8();
22440 *v = val;
22441 }
22442 Ok(__struct)
22443 }
22444 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22445 let mut __tmp = BytesMut::new(bytes);
22446 #[allow(clippy::absurd_extreme_comparisons)]
22447 #[allow(unused_comparisons)]
22448 if __tmp.remaining() < Self::ENCODED_LEN {
22449 panic!(
22450 "buffer is too small (need {} bytes, but got {})",
22451 Self::ENCODED_LEN,
22452 __tmp.remaining(),
22453 )
22454 }
22455 __tmp.put_u8(self.target_system);
22456 __tmp.put_u8(self.target_component);
22457 for val in &self.id_or_mac {
22458 __tmp.put_u8(*val);
22459 }
22460 __tmp.put_u8(self.single_message_size);
22461 __tmp.put_u8(self.msg_pack_size);
22462 for val in &self.messages {
22463 __tmp.put_u8(*val);
22464 }
22465 if matches!(version, MavlinkVersion::V2) {
22466 let len = __tmp.len();
22467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22468 } else {
22469 __tmp.len()
22470 }
22471 }
22472}
22473#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22474#[doc = ""]
22475#[doc = "ID: 12905"]
22476#[derive(Debug, Clone, PartialEq)]
22477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22479#[cfg_attr(feature = "ts", derive(TS))]
22480#[cfg_attr(feature = "ts", ts(export))]
22481pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22482 #[doc = "System ID (0 for broadcast)."]
22483 pub target_system: u8,
22484 #[doc = "Component ID (0 for broadcast)."]
22485 pub target_component: u8,
22486 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22487 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22488 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22489 pub id_or_mac: [u8; 20],
22490 #[doc = "Indicates the type of the operator_id field."]
22491 pub operator_id_type: MavOdidOperatorIdType,
22492 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22493 #[cfg_attr(
22494 feature = "serde",
22495 serde(
22496 serialize_with = "crate::nulstr::serialize::<_, 20>",
22497 deserialize_with = "crate::nulstr::deserialize::<_, 20>"
22498 )
22499 )]
22500 #[cfg_attr(feature = "ts", ts(type = "string"))]
22501 pub operator_id: [u8; 20],
22502}
22503impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22504 pub const ENCODED_LEN: usize = 43usize;
22505 pub const DEFAULT: Self = Self {
22506 target_system: 0_u8,
22507 target_component: 0_u8,
22508 id_or_mac: [0_u8; 20usize],
22509 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22510 operator_id: [0_u8; 20usize],
22511 };
22512 #[cfg(feature = "arbitrary")]
22513 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22514 use arbitrary::{Arbitrary, Unstructured};
22515 let mut buf = [0u8; 1024];
22516 rng.fill_bytes(&mut buf);
22517 let mut unstructured = Unstructured::new(&buf);
22518 Self::arbitrary(&mut unstructured).unwrap_or_default()
22519 }
22520}
22521impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22522 fn default() -> Self {
22523 Self::DEFAULT.clone()
22524 }
22525}
22526impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22527 type Message = MavMessage;
22528 const ID: u32 = 12905u32;
22529 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22530 const EXTRA_CRC: u8 = 49u8;
22531 const ENCODED_LEN: usize = 43usize;
22532 fn deser(
22533 _version: MavlinkVersion,
22534 __input: &[u8],
22535 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22536 let avail_len = __input.len();
22537 let mut payload_buf = [0; Self::ENCODED_LEN];
22538 let mut buf = if avail_len < Self::ENCODED_LEN {
22539 payload_buf[0..avail_len].copy_from_slice(__input);
22540 Bytes::new(&payload_buf)
22541 } else {
22542 Bytes::new(__input)
22543 };
22544 let mut __struct = Self::default();
22545 __struct.target_system = buf.get_u8();
22546 __struct.target_component = buf.get_u8();
22547 for v in &mut __struct.id_or_mac {
22548 let val = buf.get_u8();
22549 *v = val;
22550 }
22551 let tmp = buf.get_u8();
22552 __struct.operator_id_type =
22553 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22554 enum_type: "MavOdidOperatorIdType",
22555 value: tmp as u32,
22556 })?;
22557 for v in &mut __struct.operator_id {
22558 let val = buf.get_u8();
22559 *v = val;
22560 }
22561 Ok(__struct)
22562 }
22563 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22564 let mut __tmp = BytesMut::new(bytes);
22565 #[allow(clippy::absurd_extreme_comparisons)]
22566 #[allow(unused_comparisons)]
22567 if __tmp.remaining() < Self::ENCODED_LEN {
22568 panic!(
22569 "buffer is too small (need {} bytes, but got {})",
22570 Self::ENCODED_LEN,
22571 __tmp.remaining(),
22572 )
22573 }
22574 __tmp.put_u8(self.target_system);
22575 __tmp.put_u8(self.target_component);
22576 for val in &self.id_or_mac {
22577 __tmp.put_u8(*val);
22578 }
22579 __tmp.put_u8(self.operator_id_type as u8);
22580 for val in &self.operator_id {
22581 __tmp.put_u8(*val);
22582 }
22583 if matches!(version, MavlinkVersion::V2) {
22584 let len = __tmp.len();
22585 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22586 } else {
22587 __tmp.len()
22588 }
22589 }
22590}
22591#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22592#[doc = ""]
22593#[doc = "ID: 12903"]
22594#[derive(Debug, Clone, PartialEq)]
22595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22597#[cfg_attr(feature = "ts", derive(TS))]
22598#[cfg_attr(feature = "ts", ts(export))]
22599pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22600 #[doc = "System ID (0 for broadcast)."]
22601 pub target_system: u8,
22602 #[doc = "Component ID (0 for broadcast)."]
22603 pub target_component: u8,
22604 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22605 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22606 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22607 pub id_or_mac: [u8; 20],
22608 #[doc = "Indicates the type of the description field."]
22609 pub description_type: MavOdidDescType,
22610 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22611 #[cfg_attr(
22612 feature = "serde",
22613 serde(
22614 serialize_with = "crate::nulstr::serialize::<_, 23>",
22615 deserialize_with = "crate::nulstr::deserialize::<_, 23>"
22616 )
22617 )]
22618 #[cfg_attr(feature = "ts", ts(type = "string"))]
22619 pub description: [u8; 23],
22620}
22621impl OPEN_DRONE_ID_SELF_ID_DATA {
22622 pub const ENCODED_LEN: usize = 46usize;
22623 pub const DEFAULT: Self = Self {
22624 target_system: 0_u8,
22625 target_component: 0_u8,
22626 id_or_mac: [0_u8; 20usize],
22627 description_type: MavOdidDescType::DEFAULT,
22628 description: [0_u8; 23usize],
22629 };
22630 #[cfg(feature = "arbitrary")]
22631 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22632 use arbitrary::{Arbitrary, Unstructured};
22633 let mut buf = [0u8; 1024];
22634 rng.fill_bytes(&mut buf);
22635 let mut unstructured = Unstructured::new(&buf);
22636 Self::arbitrary(&mut unstructured).unwrap_or_default()
22637 }
22638}
22639impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22640 fn default() -> Self {
22641 Self::DEFAULT.clone()
22642 }
22643}
22644impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22645 type Message = MavMessage;
22646 const ID: u32 = 12903u32;
22647 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22648 const EXTRA_CRC: u8 = 249u8;
22649 const ENCODED_LEN: usize = 46usize;
22650 fn deser(
22651 _version: MavlinkVersion,
22652 __input: &[u8],
22653 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22654 let avail_len = __input.len();
22655 let mut payload_buf = [0; Self::ENCODED_LEN];
22656 let mut buf = if avail_len < Self::ENCODED_LEN {
22657 payload_buf[0..avail_len].copy_from_slice(__input);
22658 Bytes::new(&payload_buf)
22659 } else {
22660 Bytes::new(__input)
22661 };
22662 let mut __struct = Self::default();
22663 __struct.target_system = buf.get_u8();
22664 __struct.target_component = buf.get_u8();
22665 for v in &mut __struct.id_or_mac {
22666 let val = buf.get_u8();
22667 *v = val;
22668 }
22669 let tmp = buf.get_u8();
22670 __struct.description_type =
22671 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22672 enum_type: "MavOdidDescType",
22673 value: tmp as u32,
22674 })?;
22675 for v in &mut __struct.description {
22676 let val = buf.get_u8();
22677 *v = val;
22678 }
22679 Ok(__struct)
22680 }
22681 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22682 let mut __tmp = BytesMut::new(bytes);
22683 #[allow(clippy::absurd_extreme_comparisons)]
22684 #[allow(unused_comparisons)]
22685 if __tmp.remaining() < Self::ENCODED_LEN {
22686 panic!(
22687 "buffer is too small (need {} bytes, but got {})",
22688 Self::ENCODED_LEN,
22689 __tmp.remaining(),
22690 )
22691 }
22692 __tmp.put_u8(self.target_system);
22693 __tmp.put_u8(self.target_component);
22694 for val in &self.id_or_mac {
22695 __tmp.put_u8(*val);
22696 }
22697 __tmp.put_u8(self.description_type as u8);
22698 for val in &self.description {
22699 __tmp.put_u8(*val);
22700 }
22701 if matches!(version, MavlinkVersion::V2) {
22702 let len = __tmp.len();
22703 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22704 } else {
22705 __tmp.len()
22706 }
22707 }
22708}
22709#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22710#[doc = ""]
22711#[doc = "ID: 12904"]
22712#[derive(Debug, Clone, PartialEq)]
22713#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22715#[cfg_attr(feature = "ts", derive(TS))]
22716#[cfg_attr(feature = "ts", ts(export))]
22717pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22718 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22719 pub operator_latitude: i32,
22720 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22721 pub operator_longitude: i32,
22722 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22723 pub area_ceiling: f32,
22724 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22725 pub area_floor: f32,
22726 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22727 pub operator_altitude_geo: f32,
22728 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22729 pub timestamp: u32,
22730 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22731 pub area_count: u16,
22732 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22733 pub area_radius: u16,
22734 #[doc = "System ID (0 for broadcast)."]
22735 pub target_system: u8,
22736 #[doc = "Component ID (0 for broadcast)."]
22737 pub target_component: u8,
22738 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22739 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22740 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22741 pub id_or_mac: [u8; 20],
22742 #[doc = "Specifies the operator location type."]
22743 pub operator_location_type: MavOdidOperatorLocationType,
22744 #[doc = "Specifies the classification type of the UA."]
22745 pub classification_type: MavOdidClassificationType,
22746 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22747 pub category_eu: MavOdidCategoryEu,
22748 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22749 pub class_eu: MavOdidClassEu,
22750}
22751impl OPEN_DRONE_ID_SYSTEM_DATA {
22752 pub const ENCODED_LEN: usize = 54usize;
22753 pub const DEFAULT: Self = Self {
22754 operator_latitude: 0_i32,
22755 operator_longitude: 0_i32,
22756 area_ceiling: 0.0_f32,
22757 area_floor: 0.0_f32,
22758 operator_altitude_geo: 0.0_f32,
22759 timestamp: 0_u32,
22760 area_count: 0_u16,
22761 area_radius: 0_u16,
22762 target_system: 0_u8,
22763 target_component: 0_u8,
22764 id_or_mac: [0_u8; 20usize],
22765 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22766 classification_type: MavOdidClassificationType::DEFAULT,
22767 category_eu: MavOdidCategoryEu::DEFAULT,
22768 class_eu: MavOdidClassEu::DEFAULT,
22769 };
22770 #[cfg(feature = "arbitrary")]
22771 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22772 use arbitrary::{Arbitrary, Unstructured};
22773 let mut buf = [0u8; 1024];
22774 rng.fill_bytes(&mut buf);
22775 let mut unstructured = Unstructured::new(&buf);
22776 Self::arbitrary(&mut unstructured).unwrap_or_default()
22777 }
22778}
22779impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22780 fn default() -> Self {
22781 Self::DEFAULT.clone()
22782 }
22783}
22784impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22785 type Message = MavMessage;
22786 const ID: u32 = 12904u32;
22787 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22788 const EXTRA_CRC: u8 = 77u8;
22789 const ENCODED_LEN: usize = 54usize;
22790 fn deser(
22791 _version: MavlinkVersion,
22792 __input: &[u8],
22793 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22794 let avail_len = __input.len();
22795 let mut payload_buf = [0; Self::ENCODED_LEN];
22796 let mut buf = if avail_len < Self::ENCODED_LEN {
22797 payload_buf[0..avail_len].copy_from_slice(__input);
22798 Bytes::new(&payload_buf)
22799 } else {
22800 Bytes::new(__input)
22801 };
22802 let mut __struct = Self::default();
22803 __struct.operator_latitude = buf.get_i32_le();
22804 __struct.operator_longitude = buf.get_i32_le();
22805 __struct.area_ceiling = buf.get_f32_le();
22806 __struct.area_floor = buf.get_f32_le();
22807 __struct.operator_altitude_geo = buf.get_f32_le();
22808 __struct.timestamp = buf.get_u32_le();
22809 __struct.area_count = buf.get_u16_le();
22810 __struct.area_radius = buf.get_u16_le();
22811 __struct.target_system = buf.get_u8();
22812 __struct.target_component = buf.get_u8();
22813 for v in &mut __struct.id_or_mac {
22814 let val = buf.get_u8();
22815 *v = val;
22816 }
22817 let tmp = buf.get_u8();
22818 __struct.operator_location_type =
22819 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22820 enum_type: "MavOdidOperatorLocationType",
22821 value: tmp as u32,
22822 })?;
22823 let tmp = buf.get_u8();
22824 __struct.classification_type =
22825 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22826 enum_type: "MavOdidClassificationType",
22827 value: tmp as u32,
22828 })?;
22829 let tmp = buf.get_u8();
22830 __struct.category_eu =
22831 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22832 enum_type: "MavOdidCategoryEu",
22833 value: tmp as u32,
22834 })?;
22835 let tmp = buf.get_u8();
22836 __struct.class_eu =
22837 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22838 enum_type: "MavOdidClassEu",
22839 value: tmp as u32,
22840 })?;
22841 Ok(__struct)
22842 }
22843 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22844 let mut __tmp = BytesMut::new(bytes);
22845 #[allow(clippy::absurd_extreme_comparisons)]
22846 #[allow(unused_comparisons)]
22847 if __tmp.remaining() < Self::ENCODED_LEN {
22848 panic!(
22849 "buffer is too small (need {} bytes, but got {})",
22850 Self::ENCODED_LEN,
22851 __tmp.remaining(),
22852 )
22853 }
22854 __tmp.put_i32_le(self.operator_latitude);
22855 __tmp.put_i32_le(self.operator_longitude);
22856 __tmp.put_f32_le(self.area_ceiling);
22857 __tmp.put_f32_le(self.area_floor);
22858 __tmp.put_f32_le(self.operator_altitude_geo);
22859 __tmp.put_u32_le(self.timestamp);
22860 __tmp.put_u16_le(self.area_count);
22861 __tmp.put_u16_le(self.area_radius);
22862 __tmp.put_u8(self.target_system);
22863 __tmp.put_u8(self.target_component);
22864 for val in &self.id_or_mac {
22865 __tmp.put_u8(*val);
22866 }
22867 __tmp.put_u8(self.operator_location_type as u8);
22868 __tmp.put_u8(self.classification_type as u8);
22869 __tmp.put_u8(self.category_eu as u8);
22870 __tmp.put_u8(self.class_eu as u8);
22871 if matches!(version, MavlinkVersion::V2) {
22872 let len = __tmp.len();
22873 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22874 } else {
22875 __tmp.len()
22876 }
22877 }
22878}
22879#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22880#[doc = ""]
22881#[doc = "ID: 12919"]
22882#[derive(Debug, Clone, PartialEq)]
22883#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22885#[cfg_attr(feature = "ts", derive(TS))]
22886#[cfg_attr(feature = "ts", ts(export))]
22887pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22888 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22889 pub operator_latitude: i32,
22890 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22891 pub operator_longitude: i32,
22892 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22893 pub operator_altitude_geo: f32,
22894 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22895 pub timestamp: u32,
22896 #[doc = "System ID (0 for broadcast)."]
22897 pub target_system: u8,
22898 #[doc = "Component ID (0 for broadcast)."]
22899 pub target_component: u8,
22900}
22901impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22902 pub const ENCODED_LEN: usize = 18usize;
22903 pub const DEFAULT: Self = Self {
22904 operator_latitude: 0_i32,
22905 operator_longitude: 0_i32,
22906 operator_altitude_geo: 0.0_f32,
22907 timestamp: 0_u32,
22908 target_system: 0_u8,
22909 target_component: 0_u8,
22910 };
22911 #[cfg(feature = "arbitrary")]
22912 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22913 use arbitrary::{Arbitrary, Unstructured};
22914 let mut buf = [0u8; 1024];
22915 rng.fill_bytes(&mut buf);
22916 let mut unstructured = Unstructured::new(&buf);
22917 Self::arbitrary(&mut unstructured).unwrap_or_default()
22918 }
22919}
22920impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22921 fn default() -> Self {
22922 Self::DEFAULT.clone()
22923 }
22924}
22925impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22926 type Message = MavMessage;
22927 const ID: u32 = 12919u32;
22928 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22929 const EXTRA_CRC: u8 = 7u8;
22930 const ENCODED_LEN: usize = 18usize;
22931 fn deser(
22932 _version: MavlinkVersion,
22933 __input: &[u8],
22934 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22935 let avail_len = __input.len();
22936 let mut payload_buf = [0; Self::ENCODED_LEN];
22937 let mut buf = if avail_len < Self::ENCODED_LEN {
22938 payload_buf[0..avail_len].copy_from_slice(__input);
22939 Bytes::new(&payload_buf)
22940 } else {
22941 Bytes::new(__input)
22942 };
22943 let mut __struct = Self::default();
22944 __struct.operator_latitude = buf.get_i32_le();
22945 __struct.operator_longitude = buf.get_i32_le();
22946 __struct.operator_altitude_geo = buf.get_f32_le();
22947 __struct.timestamp = buf.get_u32_le();
22948 __struct.target_system = buf.get_u8();
22949 __struct.target_component = buf.get_u8();
22950 Ok(__struct)
22951 }
22952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22953 let mut __tmp = BytesMut::new(bytes);
22954 #[allow(clippy::absurd_extreme_comparisons)]
22955 #[allow(unused_comparisons)]
22956 if __tmp.remaining() < Self::ENCODED_LEN {
22957 panic!(
22958 "buffer is too small (need {} bytes, but got {})",
22959 Self::ENCODED_LEN,
22960 __tmp.remaining(),
22961 )
22962 }
22963 __tmp.put_i32_le(self.operator_latitude);
22964 __tmp.put_i32_le(self.operator_longitude);
22965 __tmp.put_f32_le(self.operator_altitude_geo);
22966 __tmp.put_u32_le(self.timestamp);
22967 __tmp.put_u8(self.target_system);
22968 __tmp.put_u8(self.target_component);
22969 if matches!(version, MavlinkVersion::V2) {
22970 let len = __tmp.len();
22971 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22972 } else {
22973 __tmp.len()
22974 }
22975 }
22976}
22977#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22978#[doc = ""]
22979#[doc = "ID: 100"]
22980#[derive(Debug, Clone, PartialEq)]
22981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22983#[cfg_attr(feature = "ts", derive(TS))]
22984#[cfg_attr(feature = "ts", ts(export))]
22985pub struct OPTICAL_FLOW_DATA {
22986 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22987 pub time_usec: u64,
22988 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22989 pub flow_comp_m_x: f32,
22990 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22991 pub flow_comp_m_y: f32,
22992 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22993 pub ground_distance: f32,
22994 #[doc = "Flow in x-sensor direction"]
22995 pub flow_x: i16,
22996 #[doc = "Flow in y-sensor direction"]
22997 pub flow_y: i16,
22998 #[doc = "Sensor ID"]
22999 pub sensor_id: u8,
23000 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
23001 pub quality: u8,
23002 #[doc = "Flow rate about X axis"]
23003 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23004 pub flow_rate_x: f32,
23005 #[doc = "Flow rate about Y axis"]
23006 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23007 pub flow_rate_y: f32,
23008}
23009impl OPTICAL_FLOW_DATA {
23010 pub const ENCODED_LEN: usize = 34usize;
23011 pub const DEFAULT: Self = Self {
23012 time_usec: 0_u64,
23013 flow_comp_m_x: 0.0_f32,
23014 flow_comp_m_y: 0.0_f32,
23015 ground_distance: 0.0_f32,
23016 flow_x: 0_i16,
23017 flow_y: 0_i16,
23018 sensor_id: 0_u8,
23019 quality: 0_u8,
23020 flow_rate_x: 0.0_f32,
23021 flow_rate_y: 0.0_f32,
23022 };
23023 #[cfg(feature = "arbitrary")]
23024 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23025 use arbitrary::{Arbitrary, Unstructured};
23026 let mut buf = [0u8; 1024];
23027 rng.fill_bytes(&mut buf);
23028 let mut unstructured = Unstructured::new(&buf);
23029 Self::arbitrary(&mut unstructured).unwrap_or_default()
23030 }
23031}
23032impl Default for OPTICAL_FLOW_DATA {
23033 fn default() -> Self {
23034 Self::DEFAULT.clone()
23035 }
23036}
23037impl MessageData for OPTICAL_FLOW_DATA {
23038 type Message = MavMessage;
23039 const ID: u32 = 100u32;
23040 const NAME: &'static str = "OPTICAL_FLOW";
23041 const EXTRA_CRC: u8 = 175u8;
23042 const ENCODED_LEN: usize = 34usize;
23043 fn deser(
23044 _version: MavlinkVersion,
23045 __input: &[u8],
23046 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23047 let avail_len = __input.len();
23048 let mut payload_buf = [0; Self::ENCODED_LEN];
23049 let mut buf = if avail_len < Self::ENCODED_LEN {
23050 payload_buf[0..avail_len].copy_from_slice(__input);
23051 Bytes::new(&payload_buf)
23052 } else {
23053 Bytes::new(__input)
23054 };
23055 let mut __struct = Self::default();
23056 __struct.time_usec = buf.get_u64_le();
23057 __struct.flow_comp_m_x = buf.get_f32_le();
23058 __struct.flow_comp_m_y = buf.get_f32_le();
23059 __struct.ground_distance = buf.get_f32_le();
23060 __struct.flow_x = buf.get_i16_le();
23061 __struct.flow_y = buf.get_i16_le();
23062 __struct.sensor_id = buf.get_u8();
23063 __struct.quality = buf.get_u8();
23064 __struct.flow_rate_x = buf.get_f32_le();
23065 __struct.flow_rate_y = buf.get_f32_le();
23066 Ok(__struct)
23067 }
23068 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23069 let mut __tmp = BytesMut::new(bytes);
23070 #[allow(clippy::absurd_extreme_comparisons)]
23071 #[allow(unused_comparisons)]
23072 if __tmp.remaining() < Self::ENCODED_LEN {
23073 panic!(
23074 "buffer is too small (need {} bytes, but got {})",
23075 Self::ENCODED_LEN,
23076 __tmp.remaining(),
23077 )
23078 }
23079 __tmp.put_u64_le(self.time_usec);
23080 __tmp.put_f32_le(self.flow_comp_m_x);
23081 __tmp.put_f32_le(self.flow_comp_m_y);
23082 __tmp.put_f32_le(self.ground_distance);
23083 __tmp.put_i16_le(self.flow_x);
23084 __tmp.put_i16_le(self.flow_y);
23085 __tmp.put_u8(self.sensor_id);
23086 __tmp.put_u8(self.quality);
23087 if matches!(version, MavlinkVersion::V2) {
23088 __tmp.put_f32_le(self.flow_rate_x);
23089 __tmp.put_f32_le(self.flow_rate_y);
23090 let len = __tmp.len();
23091 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23092 } else {
23093 __tmp.len()
23094 }
23095 }
23096}
23097#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
23098#[doc = ""]
23099#[doc = "ID: 106"]
23100#[derive(Debug, Clone, PartialEq)]
23101#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23102#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23103#[cfg_attr(feature = "ts", derive(TS))]
23104#[cfg_attr(feature = "ts", ts(export))]
23105pub struct OPTICAL_FLOW_RAD_DATA {
23106 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23107 pub time_usec: u64,
23108 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
23109 pub integration_time_us: u32,
23110 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
23111 pub integrated_x: f32,
23112 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
23113 pub integrated_y: f32,
23114 #[doc = "RH rotation around X axis"]
23115 pub integrated_xgyro: f32,
23116 #[doc = "RH rotation around Y axis"]
23117 pub integrated_ygyro: f32,
23118 #[doc = "RH rotation around Z axis"]
23119 pub integrated_zgyro: f32,
23120 #[doc = "Time since the distance was sampled."]
23121 pub time_delta_distance_us: u32,
23122 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
23123 pub distance: f32,
23124 #[doc = "Temperature"]
23125 pub temperature: i16,
23126 #[doc = "Sensor ID"]
23127 pub sensor_id: u8,
23128 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
23129 pub quality: u8,
23130}
23131impl OPTICAL_FLOW_RAD_DATA {
23132 pub const ENCODED_LEN: usize = 44usize;
23133 pub const DEFAULT: Self = Self {
23134 time_usec: 0_u64,
23135 integration_time_us: 0_u32,
23136 integrated_x: 0.0_f32,
23137 integrated_y: 0.0_f32,
23138 integrated_xgyro: 0.0_f32,
23139 integrated_ygyro: 0.0_f32,
23140 integrated_zgyro: 0.0_f32,
23141 time_delta_distance_us: 0_u32,
23142 distance: 0.0_f32,
23143 temperature: 0_i16,
23144 sensor_id: 0_u8,
23145 quality: 0_u8,
23146 };
23147 #[cfg(feature = "arbitrary")]
23148 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23149 use arbitrary::{Arbitrary, Unstructured};
23150 let mut buf = [0u8; 1024];
23151 rng.fill_bytes(&mut buf);
23152 let mut unstructured = Unstructured::new(&buf);
23153 Self::arbitrary(&mut unstructured).unwrap_or_default()
23154 }
23155}
23156impl Default for OPTICAL_FLOW_RAD_DATA {
23157 fn default() -> Self {
23158 Self::DEFAULT.clone()
23159 }
23160}
23161impl MessageData for OPTICAL_FLOW_RAD_DATA {
23162 type Message = MavMessage;
23163 const ID: u32 = 106u32;
23164 const NAME: &'static str = "OPTICAL_FLOW_RAD";
23165 const EXTRA_CRC: u8 = 138u8;
23166 const ENCODED_LEN: usize = 44usize;
23167 fn deser(
23168 _version: MavlinkVersion,
23169 __input: &[u8],
23170 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23171 let avail_len = __input.len();
23172 let mut payload_buf = [0; Self::ENCODED_LEN];
23173 let mut buf = if avail_len < Self::ENCODED_LEN {
23174 payload_buf[0..avail_len].copy_from_slice(__input);
23175 Bytes::new(&payload_buf)
23176 } else {
23177 Bytes::new(__input)
23178 };
23179 let mut __struct = Self::default();
23180 __struct.time_usec = buf.get_u64_le();
23181 __struct.integration_time_us = buf.get_u32_le();
23182 __struct.integrated_x = buf.get_f32_le();
23183 __struct.integrated_y = buf.get_f32_le();
23184 __struct.integrated_xgyro = buf.get_f32_le();
23185 __struct.integrated_ygyro = buf.get_f32_le();
23186 __struct.integrated_zgyro = buf.get_f32_le();
23187 __struct.time_delta_distance_us = buf.get_u32_le();
23188 __struct.distance = buf.get_f32_le();
23189 __struct.temperature = buf.get_i16_le();
23190 __struct.sensor_id = buf.get_u8();
23191 __struct.quality = buf.get_u8();
23192 Ok(__struct)
23193 }
23194 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23195 let mut __tmp = BytesMut::new(bytes);
23196 #[allow(clippy::absurd_extreme_comparisons)]
23197 #[allow(unused_comparisons)]
23198 if __tmp.remaining() < Self::ENCODED_LEN {
23199 panic!(
23200 "buffer is too small (need {} bytes, but got {})",
23201 Self::ENCODED_LEN,
23202 __tmp.remaining(),
23203 )
23204 }
23205 __tmp.put_u64_le(self.time_usec);
23206 __tmp.put_u32_le(self.integration_time_us);
23207 __tmp.put_f32_le(self.integrated_x);
23208 __tmp.put_f32_le(self.integrated_y);
23209 __tmp.put_f32_le(self.integrated_xgyro);
23210 __tmp.put_f32_le(self.integrated_ygyro);
23211 __tmp.put_f32_le(self.integrated_zgyro);
23212 __tmp.put_u32_le(self.time_delta_distance_us);
23213 __tmp.put_f32_le(self.distance);
23214 __tmp.put_i16_le(self.temperature);
23215 __tmp.put_u8(self.sensor_id);
23216 __tmp.put_u8(self.quality);
23217 if matches!(version, MavlinkVersion::V2) {
23218 let len = __tmp.len();
23219 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23220 } else {
23221 __tmp.len()
23222 }
23223 }
23224}
23225#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23226#[doc = ""]
23227#[doc = "ID: 360"]
23228#[derive(Debug, Clone, PartialEq)]
23229#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23230#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23231#[cfg_attr(feature = "ts", derive(TS))]
23232#[cfg_attr(feature = "ts", ts(export))]
23233pub struct ORBIT_EXECUTION_STATUS_DATA {
23234 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23235 pub time_usec: u64,
23236 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23237 pub radius: f32,
23238 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23239 pub x: i32,
23240 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23241 pub y: i32,
23242 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23243 pub z: f32,
23244 #[doc = "The coordinate system of the fields: x, y, z."]
23245 pub frame: MavFrame,
23246}
23247impl ORBIT_EXECUTION_STATUS_DATA {
23248 pub const ENCODED_LEN: usize = 25usize;
23249 pub const DEFAULT: Self = Self {
23250 time_usec: 0_u64,
23251 radius: 0.0_f32,
23252 x: 0_i32,
23253 y: 0_i32,
23254 z: 0.0_f32,
23255 frame: MavFrame::DEFAULT,
23256 };
23257 #[cfg(feature = "arbitrary")]
23258 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23259 use arbitrary::{Arbitrary, Unstructured};
23260 let mut buf = [0u8; 1024];
23261 rng.fill_bytes(&mut buf);
23262 let mut unstructured = Unstructured::new(&buf);
23263 Self::arbitrary(&mut unstructured).unwrap_or_default()
23264 }
23265}
23266impl Default for ORBIT_EXECUTION_STATUS_DATA {
23267 fn default() -> Self {
23268 Self::DEFAULT.clone()
23269 }
23270}
23271impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23272 type Message = MavMessage;
23273 const ID: u32 = 360u32;
23274 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23275 const EXTRA_CRC: u8 = 11u8;
23276 const ENCODED_LEN: usize = 25usize;
23277 fn deser(
23278 _version: MavlinkVersion,
23279 __input: &[u8],
23280 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23281 let avail_len = __input.len();
23282 let mut payload_buf = [0; Self::ENCODED_LEN];
23283 let mut buf = if avail_len < Self::ENCODED_LEN {
23284 payload_buf[0..avail_len].copy_from_slice(__input);
23285 Bytes::new(&payload_buf)
23286 } else {
23287 Bytes::new(__input)
23288 };
23289 let mut __struct = Self::default();
23290 __struct.time_usec = buf.get_u64_le();
23291 __struct.radius = buf.get_f32_le();
23292 __struct.x = buf.get_i32_le();
23293 __struct.y = buf.get_i32_le();
23294 __struct.z = buf.get_f32_le();
23295 let tmp = buf.get_u8();
23296 __struct.frame =
23297 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23298 enum_type: "MavFrame",
23299 value: tmp as u32,
23300 })?;
23301 Ok(__struct)
23302 }
23303 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23304 let mut __tmp = BytesMut::new(bytes);
23305 #[allow(clippy::absurd_extreme_comparisons)]
23306 #[allow(unused_comparisons)]
23307 if __tmp.remaining() < Self::ENCODED_LEN {
23308 panic!(
23309 "buffer is too small (need {} bytes, but got {})",
23310 Self::ENCODED_LEN,
23311 __tmp.remaining(),
23312 )
23313 }
23314 __tmp.put_u64_le(self.time_usec);
23315 __tmp.put_f32_le(self.radius);
23316 __tmp.put_i32_le(self.x);
23317 __tmp.put_i32_le(self.y);
23318 __tmp.put_f32_le(self.z);
23319 __tmp.put_u8(self.frame as u8);
23320 if matches!(version, MavlinkVersion::V2) {
23321 let len = __tmp.len();
23322 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23323 } else {
23324 __tmp.len()
23325 }
23326 }
23327}
23328#[doc = "Response from a PARAM_EXT_SET message."]
23329#[doc = ""]
23330#[doc = "ID: 324"]
23331#[derive(Debug, Clone, PartialEq)]
23332#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23333#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23334#[cfg_attr(feature = "ts", derive(TS))]
23335#[cfg_attr(feature = "ts", ts(export))]
23336pub struct PARAM_EXT_ACK_DATA {
23337 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23338 #[cfg_attr(
23339 feature = "serde",
23340 serde(
23341 serialize_with = "crate::nulstr::serialize::<_, 16>",
23342 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23343 )
23344 )]
23345 #[cfg_attr(feature = "ts", ts(type = "string"))]
23346 pub param_id: [u8; 16],
23347 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23348 #[cfg_attr(
23349 feature = "serde",
23350 serde(
23351 serialize_with = "crate::nulstr::serialize::<_, 128>",
23352 deserialize_with = "crate::nulstr::deserialize::<_, 128>"
23353 )
23354 )]
23355 #[cfg_attr(feature = "ts", ts(type = "string"))]
23356 pub param_value: [u8; 128],
23357 #[doc = "Parameter type."]
23358 pub param_type: MavParamExtType,
23359 #[doc = "Result code."]
23360 pub param_result: ParamAck,
23361}
23362impl PARAM_EXT_ACK_DATA {
23363 pub const ENCODED_LEN: usize = 146usize;
23364 pub const DEFAULT: Self = Self {
23365 param_id: [0_u8; 16usize],
23366 param_value: [0_u8; 128usize],
23367 param_type: MavParamExtType::DEFAULT,
23368 param_result: ParamAck::DEFAULT,
23369 };
23370 #[cfg(feature = "arbitrary")]
23371 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23372 use arbitrary::{Arbitrary, Unstructured};
23373 let mut buf = [0u8; 1024];
23374 rng.fill_bytes(&mut buf);
23375 let mut unstructured = Unstructured::new(&buf);
23376 Self::arbitrary(&mut unstructured).unwrap_or_default()
23377 }
23378}
23379impl Default for PARAM_EXT_ACK_DATA {
23380 fn default() -> Self {
23381 Self::DEFAULT.clone()
23382 }
23383}
23384impl MessageData for PARAM_EXT_ACK_DATA {
23385 type Message = MavMessage;
23386 const ID: u32 = 324u32;
23387 const NAME: &'static str = "PARAM_EXT_ACK";
23388 const EXTRA_CRC: u8 = 132u8;
23389 const ENCODED_LEN: usize = 146usize;
23390 fn deser(
23391 _version: MavlinkVersion,
23392 __input: &[u8],
23393 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23394 let avail_len = __input.len();
23395 let mut payload_buf = [0; Self::ENCODED_LEN];
23396 let mut buf = if avail_len < Self::ENCODED_LEN {
23397 payload_buf[0..avail_len].copy_from_slice(__input);
23398 Bytes::new(&payload_buf)
23399 } else {
23400 Bytes::new(__input)
23401 };
23402 let mut __struct = Self::default();
23403 for v in &mut __struct.param_id {
23404 let val = buf.get_u8();
23405 *v = val;
23406 }
23407 for v in &mut __struct.param_value {
23408 let val = buf.get_u8();
23409 *v = val;
23410 }
23411 let tmp = buf.get_u8();
23412 __struct.param_type =
23413 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23414 enum_type: "MavParamExtType",
23415 value: tmp as u32,
23416 })?;
23417 let tmp = buf.get_u8();
23418 __struct.param_result =
23419 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23420 enum_type: "ParamAck",
23421 value: tmp as u32,
23422 })?;
23423 Ok(__struct)
23424 }
23425 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23426 let mut __tmp = BytesMut::new(bytes);
23427 #[allow(clippy::absurd_extreme_comparisons)]
23428 #[allow(unused_comparisons)]
23429 if __tmp.remaining() < Self::ENCODED_LEN {
23430 panic!(
23431 "buffer is too small (need {} bytes, but got {})",
23432 Self::ENCODED_LEN,
23433 __tmp.remaining(),
23434 )
23435 }
23436 for val in &self.param_id {
23437 __tmp.put_u8(*val);
23438 }
23439 for val in &self.param_value {
23440 __tmp.put_u8(*val);
23441 }
23442 __tmp.put_u8(self.param_type as u8);
23443 __tmp.put_u8(self.param_result as u8);
23444 if matches!(version, MavlinkVersion::V2) {
23445 let len = __tmp.len();
23446 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23447 } else {
23448 __tmp.len()
23449 }
23450 }
23451}
23452#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23453#[doc = ""]
23454#[doc = "ID: 321"]
23455#[derive(Debug, Clone, PartialEq)]
23456#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23457#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23458#[cfg_attr(feature = "ts", derive(TS))]
23459#[cfg_attr(feature = "ts", ts(export))]
23460pub struct PARAM_EXT_REQUEST_LIST_DATA {
23461 #[doc = "System ID"]
23462 pub target_system: u8,
23463 #[doc = "Component ID"]
23464 pub target_component: u8,
23465}
23466impl PARAM_EXT_REQUEST_LIST_DATA {
23467 pub const ENCODED_LEN: usize = 2usize;
23468 pub const DEFAULT: Self = Self {
23469 target_system: 0_u8,
23470 target_component: 0_u8,
23471 };
23472 #[cfg(feature = "arbitrary")]
23473 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23474 use arbitrary::{Arbitrary, Unstructured};
23475 let mut buf = [0u8; 1024];
23476 rng.fill_bytes(&mut buf);
23477 let mut unstructured = Unstructured::new(&buf);
23478 Self::arbitrary(&mut unstructured).unwrap_or_default()
23479 }
23480}
23481impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23482 fn default() -> Self {
23483 Self::DEFAULT.clone()
23484 }
23485}
23486impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23487 type Message = MavMessage;
23488 const ID: u32 = 321u32;
23489 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23490 const EXTRA_CRC: u8 = 88u8;
23491 const ENCODED_LEN: usize = 2usize;
23492 fn deser(
23493 _version: MavlinkVersion,
23494 __input: &[u8],
23495 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23496 let avail_len = __input.len();
23497 let mut payload_buf = [0; Self::ENCODED_LEN];
23498 let mut buf = if avail_len < Self::ENCODED_LEN {
23499 payload_buf[0..avail_len].copy_from_slice(__input);
23500 Bytes::new(&payload_buf)
23501 } else {
23502 Bytes::new(__input)
23503 };
23504 let mut __struct = Self::default();
23505 __struct.target_system = buf.get_u8();
23506 __struct.target_component = buf.get_u8();
23507 Ok(__struct)
23508 }
23509 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23510 let mut __tmp = BytesMut::new(bytes);
23511 #[allow(clippy::absurd_extreme_comparisons)]
23512 #[allow(unused_comparisons)]
23513 if __tmp.remaining() < Self::ENCODED_LEN {
23514 panic!(
23515 "buffer is too small (need {} bytes, but got {})",
23516 Self::ENCODED_LEN,
23517 __tmp.remaining(),
23518 )
23519 }
23520 __tmp.put_u8(self.target_system);
23521 __tmp.put_u8(self.target_component);
23522 if matches!(version, MavlinkVersion::V2) {
23523 let len = __tmp.len();
23524 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23525 } else {
23526 __tmp.len()
23527 }
23528 }
23529}
23530#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23531#[doc = ""]
23532#[doc = "ID: 320"]
23533#[derive(Debug, Clone, PartialEq)]
23534#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23535#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23536#[cfg_attr(feature = "ts", derive(TS))]
23537#[cfg_attr(feature = "ts", ts(export))]
23538pub struct PARAM_EXT_REQUEST_READ_DATA {
23539 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23540 pub param_index: i16,
23541 #[doc = "System ID"]
23542 pub target_system: u8,
23543 #[doc = "Component ID"]
23544 pub target_component: u8,
23545 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23546 #[cfg_attr(
23547 feature = "serde",
23548 serde(
23549 serialize_with = "crate::nulstr::serialize::<_, 16>",
23550 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23551 )
23552 )]
23553 #[cfg_attr(feature = "ts", ts(type = "string"))]
23554 pub param_id: [u8; 16],
23555}
23556impl PARAM_EXT_REQUEST_READ_DATA {
23557 pub const ENCODED_LEN: usize = 20usize;
23558 pub const DEFAULT: Self = Self {
23559 param_index: 0_i16,
23560 target_system: 0_u8,
23561 target_component: 0_u8,
23562 param_id: [0_u8; 16usize],
23563 };
23564 #[cfg(feature = "arbitrary")]
23565 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23566 use arbitrary::{Arbitrary, Unstructured};
23567 let mut buf = [0u8; 1024];
23568 rng.fill_bytes(&mut buf);
23569 let mut unstructured = Unstructured::new(&buf);
23570 Self::arbitrary(&mut unstructured).unwrap_or_default()
23571 }
23572}
23573impl Default for PARAM_EXT_REQUEST_READ_DATA {
23574 fn default() -> Self {
23575 Self::DEFAULT.clone()
23576 }
23577}
23578impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23579 type Message = MavMessage;
23580 const ID: u32 = 320u32;
23581 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23582 const EXTRA_CRC: u8 = 243u8;
23583 const ENCODED_LEN: usize = 20usize;
23584 fn deser(
23585 _version: MavlinkVersion,
23586 __input: &[u8],
23587 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23588 let avail_len = __input.len();
23589 let mut payload_buf = [0; Self::ENCODED_LEN];
23590 let mut buf = if avail_len < Self::ENCODED_LEN {
23591 payload_buf[0..avail_len].copy_from_slice(__input);
23592 Bytes::new(&payload_buf)
23593 } else {
23594 Bytes::new(__input)
23595 };
23596 let mut __struct = Self::default();
23597 __struct.param_index = buf.get_i16_le();
23598 __struct.target_system = buf.get_u8();
23599 __struct.target_component = buf.get_u8();
23600 for v in &mut __struct.param_id {
23601 let val = buf.get_u8();
23602 *v = val;
23603 }
23604 Ok(__struct)
23605 }
23606 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23607 let mut __tmp = BytesMut::new(bytes);
23608 #[allow(clippy::absurd_extreme_comparisons)]
23609 #[allow(unused_comparisons)]
23610 if __tmp.remaining() < Self::ENCODED_LEN {
23611 panic!(
23612 "buffer is too small (need {} bytes, but got {})",
23613 Self::ENCODED_LEN,
23614 __tmp.remaining(),
23615 )
23616 }
23617 __tmp.put_i16_le(self.param_index);
23618 __tmp.put_u8(self.target_system);
23619 __tmp.put_u8(self.target_component);
23620 for val in &self.param_id {
23621 __tmp.put_u8(*val);
23622 }
23623 if matches!(version, MavlinkVersion::V2) {
23624 let len = __tmp.len();
23625 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23626 } else {
23627 __tmp.len()
23628 }
23629 }
23630}
23631#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23632#[doc = ""]
23633#[doc = "ID: 323"]
23634#[derive(Debug, Clone, PartialEq)]
23635#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23637#[cfg_attr(feature = "ts", derive(TS))]
23638#[cfg_attr(feature = "ts", ts(export))]
23639pub struct PARAM_EXT_SET_DATA {
23640 #[doc = "System ID"]
23641 pub target_system: u8,
23642 #[doc = "Component ID"]
23643 pub target_component: u8,
23644 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23645 #[cfg_attr(
23646 feature = "serde",
23647 serde(
23648 serialize_with = "crate::nulstr::serialize::<_, 16>",
23649 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23650 )
23651 )]
23652 #[cfg_attr(feature = "ts", ts(type = "string"))]
23653 pub param_id: [u8; 16],
23654 #[doc = "Parameter value"]
23655 #[cfg_attr(
23656 feature = "serde",
23657 serde(
23658 serialize_with = "crate::nulstr::serialize::<_, 128>",
23659 deserialize_with = "crate::nulstr::deserialize::<_, 128>"
23660 )
23661 )]
23662 #[cfg_attr(feature = "ts", ts(type = "string"))]
23663 pub param_value: [u8; 128],
23664 #[doc = "Parameter type."]
23665 pub param_type: MavParamExtType,
23666}
23667impl PARAM_EXT_SET_DATA {
23668 pub const ENCODED_LEN: usize = 147usize;
23669 pub const DEFAULT: Self = Self {
23670 target_system: 0_u8,
23671 target_component: 0_u8,
23672 param_id: [0_u8; 16usize],
23673 param_value: [0_u8; 128usize],
23674 param_type: MavParamExtType::DEFAULT,
23675 };
23676 #[cfg(feature = "arbitrary")]
23677 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23678 use arbitrary::{Arbitrary, Unstructured};
23679 let mut buf = [0u8; 1024];
23680 rng.fill_bytes(&mut buf);
23681 let mut unstructured = Unstructured::new(&buf);
23682 Self::arbitrary(&mut unstructured).unwrap_or_default()
23683 }
23684}
23685impl Default for PARAM_EXT_SET_DATA {
23686 fn default() -> Self {
23687 Self::DEFAULT.clone()
23688 }
23689}
23690impl MessageData for PARAM_EXT_SET_DATA {
23691 type Message = MavMessage;
23692 const ID: u32 = 323u32;
23693 const NAME: &'static str = "PARAM_EXT_SET";
23694 const EXTRA_CRC: u8 = 78u8;
23695 const ENCODED_LEN: usize = 147usize;
23696 fn deser(
23697 _version: MavlinkVersion,
23698 __input: &[u8],
23699 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23700 let avail_len = __input.len();
23701 let mut payload_buf = [0; Self::ENCODED_LEN];
23702 let mut buf = if avail_len < Self::ENCODED_LEN {
23703 payload_buf[0..avail_len].copy_from_slice(__input);
23704 Bytes::new(&payload_buf)
23705 } else {
23706 Bytes::new(__input)
23707 };
23708 let mut __struct = Self::default();
23709 __struct.target_system = buf.get_u8();
23710 __struct.target_component = buf.get_u8();
23711 for v in &mut __struct.param_id {
23712 let val = buf.get_u8();
23713 *v = val;
23714 }
23715 for v in &mut __struct.param_value {
23716 let val = buf.get_u8();
23717 *v = val;
23718 }
23719 let tmp = buf.get_u8();
23720 __struct.param_type =
23721 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23722 enum_type: "MavParamExtType",
23723 value: tmp as u32,
23724 })?;
23725 Ok(__struct)
23726 }
23727 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23728 let mut __tmp = BytesMut::new(bytes);
23729 #[allow(clippy::absurd_extreme_comparisons)]
23730 #[allow(unused_comparisons)]
23731 if __tmp.remaining() < Self::ENCODED_LEN {
23732 panic!(
23733 "buffer is too small (need {} bytes, but got {})",
23734 Self::ENCODED_LEN,
23735 __tmp.remaining(),
23736 )
23737 }
23738 __tmp.put_u8(self.target_system);
23739 __tmp.put_u8(self.target_component);
23740 for val in &self.param_id {
23741 __tmp.put_u8(*val);
23742 }
23743 for val in &self.param_value {
23744 __tmp.put_u8(*val);
23745 }
23746 __tmp.put_u8(self.param_type as u8);
23747 if matches!(version, MavlinkVersion::V2) {
23748 let len = __tmp.len();
23749 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23750 } else {
23751 __tmp.len()
23752 }
23753 }
23754}
23755#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23756#[doc = ""]
23757#[doc = "ID: 322"]
23758#[derive(Debug, Clone, PartialEq)]
23759#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23761#[cfg_attr(feature = "ts", derive(TS))]
23762#[cfg_attr(feature = "ts", ts(export))]
23763pub struct PARAM_EXT_VALUE_DATA {
23764 #[doc = "Total number of parameters"]
23765 pub param_count: u16,
23766 #[doc = "Index of this parameter"]
23767 pub param_index: u16,
23768 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23769 #[cfg_attr(
23770 feature = "serde",
23771 serde(
23772 serialize_with = "crate::nulstr::serialize::<_, 16>",
23773 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23774 )
23775 )]
23776 #[cfg_attr(feature = "ts", ts(type = "string"))]
23777 pub param_id: [u8; 16],
23778 #[doc = "Parameter value"]
23779 #[cfg_attr(
23780 feature = "serde",
23781 serde(
23782 serialize_with = "crate::nulstr::serialize::<_, 128>",
23783 deserialize_with = "crate::nulstr::deserialize::<_, 128>"
23784 )
23785 )]
23786 #[cfg_attr(feature = "ts", ts(type = "string"))]
23787 pub param_value: [u8; 128],
23788 #[doc = "Parameter type."]
23789 pub param_type: MavParamExtType,
23790}
23791impl PARAM_EXT_VALUE_DATA {
23792 pub const ENCODED_LEN: usize = 149usize;
23793 pub const DEFAULT: Self = Self {
23794 param_count: 0_u16,
23795 param_index: 0_u16,
23796 param_id: [0_u8; 16usize],
23797 param_value: [0_u8; 128usize],
23798 param_type: MavParamExtType::DEFAULT,
23799 };
23800 #[cfg(feature = "arbitrary")]
23801 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23802 use arbitrary::{Arbitrary, Unstructured};
23803 let mut buf = [0u8; 1024];
23804 rng.fill_bytes(&mut buf);
23805 let mut unstructured = Unstructured::new(&buf);
23806 Self::arbitrary(&mut unstructured).unwrap_or_default()
23807 }
23808}
23809impl Default for PARAM_EXT_VALUE_DATA {
23810 fn default() -> Self {
23811 Self::DEFAULT.clone()
23812 }
23813}
23814impl MessageData for PARAM_EXT_VALUE_DATA {
23815 type Message = MavMessage;
23816 const ID: u32 = 322u32;
23817 const NAME: &'static str = "PARAM_EXT_VALUE";
23818 const EXTRA_CRC: u8 = 243u8;
23819 const ENCODED_LEN: usize = 149usize;
23820 fn deser(
23821 _version: MavlinkVersion,
23822 __input: &[u8],
23823 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23824 let avail_len = __input.len();
23825 let mut payload_buf = [0; Self::ENCODED_LEN];
23826 let mut buf = if avail_len < Self::ENCODED_LEN {
23827 payload_buf[0..avail_len].copy_from_slice(__input);
23828 Bytes::new(&payload_buf)
23829 } else {
23830 Bytes::new(__input)
23831 };
23832 let mut __struct = Self::default();
23833 __struct.param_count = buf.get_u16_le();
23834 __struct.param_index = buf.get_u16_le();
23835 for v in &mut __struct.param_id {
23836 let val = buf.get_u8();
23837 *v = val;
23838 }
23839 for v in &mut __struct.param_value {
23840 let val = buf.get_u8();
23841 *v = val;
23842 }
23843 let tmp = buf.get_u8();
23844 __struct.param_type =
23845 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23846 enum_type: "MavParamExtType",
23847 value: tmp as u32,
23848 })?;
23849 Ok(__struct)
23850 }
23851 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23852 let mut __tmp = BytesMut::new(bytes);
23853 #[allow(clippy::absurd_extreme_comparisons)]
23854 #[allow(unused_comparisons)]
23855 if __tmp.remaining() < Self::ENCODED_LEN {
23856 panic!(
23857 "buffer is too small (need {} bytes, but got {})",
23858 Self::ENCODED_LEN,
23859 __tmp.remaining(),
23860 )
23861 }
23862 __tmp.put_u16_le(self.param_count);
23863 __tmp.put_u16_le(self.param_index);
23864 for val in &self.param_id {
23865 __tmp.put_u8(*val);
23866 }
23867 for val in &self.param_value {
23868 __tmp.put_u8(*val);
23869 }
23870 __tmp.put_u8(self.param_type as u8);
23871 if matches!(version, MavlinkVersion::V2) {
23872 let len = __tmp.len();
23873 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23874 } else {
23875 __tmp.len()
23876 }
23877 }
23878}
23879#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23880#[doc = ""]
23881#[doc = "ID: 50"]
23882#[derive(Debug, Clone, PartialEq)]
23883#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23885#[cfg_attr(feature = "ts", derive(TS))]
23886#[cfg_attr(feature = "ts", ts(export))]
23887pub struct PARAM_MAP_RC_DATA {
23888 #[doc = "Initial parameter value"]
23889 pub param_value0: f32,
23890 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23891 pub scale: f32,
23892 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23893 pub param_value_min: f32,
23894 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23895 pub param_value_max: f32,
23896 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23897 pub param_index: i16,
23898 #[doc = "System ID"]
23899 pub target_system: u8,
23900 #[doc = "Component ID"]
23901 pub target_component: u8,
23902 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23903 #[cfg_attr(
23904 feature = "serde",
23905 serde(
23906 serialize_with = "crate::nulstr::serialize::<_, 16>",
23907 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23908 )
23909 )]
23910 #[cfg_attr(feature = "ts", ts(type = "string"))]
23911 pub param_id: [u8; 16],
23912 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23913 pub parameter_rc_channel_index: u8,
23914}
23915impl PARAM_MAP_RC_DATA {
23916 pub const ENCODED_LEN: usize = 37usize;
23917 pub const DEFAULT: Self = Self {
23918 param_value0: 0.0_f32,
23919 scale: 0.0_f32,
23920 param_value_min: 0.0_f32,
23921 param_value_max: 0.0_f32,
23922 param_index: 0_i16,
23923 target_system: 0_u8,
23924 target_component: 0_u8,
23925 param_id: [0_u8; 16usize],
23926 parameter_rc_channel_index: 0_u8,
23927 };
23928 #[cfg(feature = "arbitrary")]
23929 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23930 use arbitrary::{Arbitrary, Unstructured};
23931 let mut buf = [0u8; 1024];
23932 rng.fill_bytes(&mut buf);
23933 let mut unstructured = Unstructured::new(&buf);
23934 Self::arbitrary(&mut unstructured).unwrap_or_default()
23935 }
23936}
23937impl Default for PARAM_MAP_RC_DATA {
23938 fn default() -> Self {
23939 Self::DEFAULT.clone()
23940 }
23941}
23942impl MessageData for PARAM_MAP_RC_DATA {
23943 type Message = MavMessage;
23944 const ID: u32 = 50u32;
23945 const NAME: &'static str = "PARAM_MAP_RC";
23946 const EXTRA_CRC: u8 = 78u8;
23947 const ENCODED_LEN: usize = 37usize;
23948 fn deser(
23949 _version: MavlinkVersion,
23950 __input: &[u8],
23951 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23952 let avail_len = __input.len();
23953 let mut payload_buf = [0; Self::ENCODED_LEN];
23954 let mut buf = if avail_len < Self::ENCODED_LEN {
23955 payload_buf[0..avail_len].copy_from_slice(__input);
23956 Bytes::new(&payload_buf)
23957 } else {
23958 Bytes::new(__input)
23959 };
23960 let mut __struct = Self::default();
23961 __struct.param_value0 = buf.get_f32_le();
23962 __struct.scale = buf.get_f32_le();
23963 __struct.param_value_min = buf.get_f32_le();
23964 __struct.param_value_max = buf.get_f32_le();
23965 __struct.param_index = buf.get_i16_le();
23966 __struct.target_system = buf.get_u8();
23967 __struct.target_component = buf.get_u8();
23968 for v in &mut __struct.param_id {
23969 let val = buf.get_u8();
23970 *v = val;
23971 }
23972 __struct.parameter_rc_channel_index = buf.get_u8();
23973 Ok(__struct)
23974 }
23975 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23976 let mut __tmp = BytesMut::new(bytes);
23977 #[allow(clippy::absurd_extreme_comparisons)]
23978 #[allow(unused_comparisons)]
23979 if __tmp.remaining() < Self::ENCODED_LEN {
23980 panic!(
23981 "buffer is too small (need {} bytes, but got {})",
23982 Self::ENCODED_LEN,
23983 __tmp.remaining(),
23984 )
23985 }
23986 __tmp.put_f32_le(self.param_value0);
23987 __tmp.put_f32_le(self.scale);
23988 __tmp.put_f32_le(self.param_value_min);
23989 __tmp.put_f32_le(self.param_value_max);
23990 __tmp.put_i16_le(self.param_index);
23991 __tmp.put_u8(self.target_system);
23992 __tmp.put_u8(self.target_component);
23993 for val in &self.param_id {
23994 __tmp.put_u8(*val);
23995 }
23996 __tmp.put_u8(self.parameter_rc_channel_index);
23997 if matches!(version, MavlinkVersion::V2) {
23998 let len = __tmp.len();
23999 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24000 } else {
24001 __tmp.len()
24002 }
24003 }
24004}
24005#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24006#[doc = ""]
24007#[doc = "ID: 21"]
24008#[derive(Debug, Clone, PartialEq)]
24009#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24010#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24011#[cfg_attr(feature = "ts", derive(TS))]
24012#[cfg_attr(feature = "ts", ts(export))]
24013pub struct PARAM_REQUEST_LIST_DATA {
24014 #[doc = "System ID"]
24015 pub target_system: u8,
24016 #[doc = "Component ID"]
24017 pub target_component: u8,
24018}
24019impl PARAM_REQUEST_LIST_DATA {
24020 pub const ENCODED_LEN: usize = 2usize;
24021 pub const DEFAULT: Self = Self {
24022 target_system: 0_u8,
24023 target_component: 0_u8,
24024 };
24025 #[cfg(feature = "arbitrary")]
24026 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24027 use arbitrary::{Arbitrary, Unstructured};
24028 let mut buf = [0u8; 1024];
24029 rng.fill_bytes(&mut buf);
24030 let mut unstructured = Unstructured::new(&buf);
24031 Self::arbitrary(&mut unstructured).unwrap_or_default()
24032 }
24033}
24034impl Default for PARAM_REQUEST_LIST_DATA {
24035 fn default() -> Self {
24036 Self::DEFAULT.clone()
24037 }
24038}
24039impl MessageData for PARAM_REQUEST_LIST_DATA {
24040 type Message = MavMessage;
24041 const ID: u32 = 21u32;
24042 const NAME: &'static str = "PARAM_REQUEST_LIST";
24043 const EXTRA_CRC: u8 = 159u8;
24044 const ENCODED_LEN: usize = 2usize;
24045 fn deser(
24046 _version: MavlinkVersion,
24047 __input: &[u8],
24048 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24049 let avail_len = __input.len();
24050 let mut payload_buf = [0; Self::ENCODED_LEN];
24051 let mut buf = if avail_len < Self::ENCODED_LEN {
24052 payload_buf[0..avail_len].copy_from_slice(__input);
24053 Bytes::new(&payload_buf)
24054 } else {
24055 Bytes::new(__input)
24056 };
24057 let mut __struct = Self::default();
24058 __struct.target_system = buf.get_u8();
24059 __struct.target_component = buf.get_u8();
24060 Ok(__struct)
24061 }
24062 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24063 let mut __tmp = BytesMut::new(bytes);
24064 #[allow(clippy::absurd_extreme_comparisons)]
24065 #[allow(unused_comparisons)]
24066 if __tmp.remaining() < Self::ENCODED_LEN {
24067 panic!(
24068 "buffer is too small (need {} bytes, but got {})",
24069 Self::ENCODED_LEN,
24070 __tmp.remaining(),
24071 )
24072 }
24073 __tmp.put_u8(self.target_system);
24074 __tmp.put_u8(self.target_component);
24075 if matches!(version, MavlinkVersion::V2) {
24076 let len = __tmp.len();
24077 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24078 } else {
24079 __tmp.len()
24080 }
24081 }
24082}
24083#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
24084#[doc = ""]
24085#[doc = "ID: 20"]
24086#[derive(Debug, Clone, PartialEq)]
24087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24089#[cfg_attr(feature = "ts", derive(TS))]
24090#[cfg_attr(feature = "ts", ts(export))]
24091pub struct PARAM_REQUEST_READ_DATA {
24092 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
24093 pub param_index: i16,
24094 #[doc = "System ID"]
24095 pub target_system: u8,
24096 #[doc = "Component ID"]
24097 pub target_component: u8,
24098 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24099 #[cfg_attr(
24100 feature = "serde",
24101 serde(
24102 serialize_with = "crate::nulstr::serialize::<_, 16>",
24103 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24104 )
24105 )]
24106 #[cfg_attr(feature = "ts", ts(type = "string"))]
24107 pub param_id: [u8; 16],
24108}
24109impl PARAM_REQUEST_READ_DATA {
24110 pub const ENCODED_LEN: usize = 20usize;
24111 pub const DEFAULT: Self = Self {
24112 param_index: 0_i16,
24113 target_system: 0_u8,
24114 target_component: 0_u8,
24115 param_id: [0_u8; 16usize],
24116 };
24117 #[cfg(feature = "arbitrary")]
24118 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24119 use arbitrary::{Arbitrary, Unstructured};
24120 let mut buf = [0u8; 1024];
24121 rng.fill_bytes(&mut buf);
24122 let mut unstructured = Unstructured::new(&buf);
24123 Self::arbitrary(&mut unstructured).unwrap_or_default()
24124 }
24125}
24126impl Default for PARAM_REQUEST_READ_DATA {
24127 fn default() -> Self {
24128 Self::DEFAULT.clone()
24129 }
24130}
24131impl MessageData for PARAM_REQUEST_READ_DATA {
24132 type Message = MavMessage;
24133 const ID: u32 = 20u32;
24134 const NAME: &'static str = "PARAM_REQUEST_READ";
24135 const EXTRA_CRC: u8 = 214u8;
24136 const ENCODED_LEN: usize = 20usize;
24137 fn deser(
24138 _version: MavlinkVersion,
24139 __input: &[u8],
24140 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24141 let avail_len = __input.len();
24142 let mut payload_buf = [0; Self::ENCODED_LEN];
24143 let mut buf = if avail_len < Self::ENCODED_LEN {
24144 payload_buf[0..avail_len].copy_from_slice(__input);
24145 Bytes::new(&payload_buf)
24146 } else {
24147 Bytes::new(__input)
24148 };
24149 let mut __struct = Self::default();
24150 __struct.param_index = buf.get_i16_le();
24151 __struct.target_system = buf.get_u8();
24152 __struct.target_component = buf.get_u8();
24153 for v in &mut __struct.param_id {
24154 let val = buf.get_u8();
24155 *v = val;
24156 }
24157 Ok(__struct)
24158 }
24159 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24160 let mut __tmp = BytesMut::new(bytes);
24161 #[allow(clippy::absurd_extreme_comparisons)]
24162 #[allow(unused_comparisons)]
24163 if __tmp.remaining() < Self::ENCODED_LEN {
24164 panic!(
24165 "buffer is too small (need {} bytes, but got {})",
24166 Self::ENCODED_LEN,
24167 __tmp.remaining(),
24168 )
24169 }
24170 __tmp.put_i16_le(self.param_index);
24171 __tmp.put_u8(self.target_system);
24172 __tmp.put_u8(self.target_component);
24173 for val in &self.param_id {
24174 __tmp.put_u8(*val);
24175 }
24176 if matches!(version, MavlinkVersion::V2) {
24177 let len = __tmp.len();
24178 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24179 } else {
24180 __tmp.len()
24181 }
24182 }
24183}
24184#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24185#[doc = ""]
24186#[doc = "ID: 23"]
24187#[derive(Debug, Clone, PartialEq)]
24188#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24189#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24190#[cfg_attr(feature = "ts", derive(TS))]
24191#[cfg_attr(feature = "ts", ts(export))]
24192pub struct PARAM_SET_DATA {
24193 #[doc = "Onboard parameter value"]
24194 pub param_value: f32,
24195 #[doc = "System ID"]
24196 pub target_system: u8,
24197 #[doc = "Component ID"]
24198 pub target_component: u8,
24199 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24200 #[cfg_attr(
24201 feature = "serde",
24202 serde(
24203 serialize_with = "crate::nulstr::serialize::<_, 16>",
24204 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24205 )
24206 )]
24207 #[cfg_attr(feature = "ts", ts(type = "string"))]
24208 pub param_id: [u8; 16],
24209 #[doc = "Onboard parameter type."]
24210 pub param_type: MavParamType,
24211}
24212impl PARAM_SET_DATA {
24213 pub const ENCODED_LEN: usize = 23usize;
24214 pub const DEFAULT: Self = Self {
24215 param_value: 0.0_f32,
24216 target_system: 0_u8,
24217 target_component: 0_u8,
24218 param_id: [0_u8; 16usize],
24219 param_type: MavParamType::DEFAULT,
24220 };
24221 #[cfg(feature = "arbitrary")]
24222 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24223 use arbitrary::{Arbitrary, Unstructured};
24224 let mut buf = [0u8; 1024];
24225 rng.fill_bytes(&mut buf);
24226 let mut unstructured = Unstructured::new(&buf);
24227 Self::arbitrary(&mut unstructured).unwrap_or_default()
24228 }
24229}
24230impl Default for PARAM_SET_DATA {
24231 fn default() -> Self {
24232 Self::DEFAULT.clone()
24233 }
24234}
24235impl MessageData for PARAM_SET_DATA {
24236 type Message = MavMessage;
24237 const ID: u32 = 23u32;
24238 const NAME: &'static str = "PARAM_SET";
24239 const EXTRA_CRC: u8 = 168u8;
24240 const ENCODED_LEN: usize = 23usize;
24241 fn deser(
24242 _version: MavlinkVersion,
24243 __input: &[u8],
24244 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24245 let avail_len = __input.len();
24246 let mut payload_buf = [0; Self::ENCODED_LEN];
24247 let mut buf = if avail_len < Self::ENCODED_LEN {
24248 payload_buf[0..avail_len].copy_from_slice(__input);
24249 Bytes::new(&payload_buf)
24250 } else {
24251 Bytes::new(__input)
24252 };
24253 let mut __struct = Self::default();
24254 __struct.param_value = buf.get_f32_le();
24255 __struct.target_system = buf.get_u8();
24256 __struct.target_component = buf.get_u8();
24257 for v in &mut __struct.param_id {
24258 let val = buf.get_u8();
24259 *v = val;
24260 }
24261 let tmp = buf.get_u8();
24262 __struct.param_type =
24263 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24264 enum_type: "MavParamType",
24265 value: tmp as u32,
24266 })?;
24267 Ok(__struct)
24268 }
24269 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24270 let mut __tmp = BytesMut::new(bytes);
24271 #[allow(clippy::absurd_extreme_comparisons)]
24272 #[allow(unused_comparisons)]
24273 if __tmp.remaining() < Self::ENCODED_LEN {
24274 panic!(
24275 "buffer is too small (need {} bytes, but got {})",
24276 Self::ENCODED_LEN,
24277 __tmp.remaining(),
24278 )
24279 }
24280 __tmp.put_f32_le(self.param_value);
24281 __tmp.put_u8(self.target_system);
24282 __tmp.put_u8(self.target_component);
24283 for val in &self.param_id {
24284 __tmp.put_u8(*val);
24285 }
24286 __tmp.put_u8(self.param_type as u8);
24287 if matches!(version, MavlinkVersion::V2) {
24288 let len = __tmp.len();
24289 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24290 } else {
24291 __tmp.len()
24292 }
24293 }
24294}
24295#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24296#[doc = ""]
24297#[doc = "ID: 22"]
24298#[derive(Debug, Clone, PartialEq)]
24299#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24300#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24301#[cfg_attr(feature = "ts", derive(TS))]
24302#[cfg_attr(feature = "ts", ts(export))]
24303pub struct PARAM_VALUE_DATA {
24304 #[doc = "Onboard parameter value"]
24305 pub param_value: f32,
24306 #[doc = "Total number of onboard parameters"]
24307 pub param_count: u16,
24308 #[doc = "Index of this onboard parameter"]
24309 pub param_index: u16,
24310 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24311 #[cfg_attr(
24312 feature = "serde",
24313 serde(
24314 serialize_with = "crate::nulstr::serialize::<_, 16>",
24315 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24316 )
24317 )]
24318 #[cfg_attr(feature = "ts", ts(type = "string"))]
24319 pub param_id: [u8; 16],
24320 #[doc = "Onboard parameter type."]
24321 pub param_type: MavParamType,
24322}
24323impl PARAM_VALUE_DATA {
24324 pub const ENCODED_LEN: usize = 25usize;
24325 pub const DEFAULT: Self = Self {
24326 param_value: 0.0_f32,
24327 param_count: 0_u16,
24328 param_index: 0_u16,
24329 param_id: [0_u8; 16usize],
24330 param_type: MavParamType::DEFAULT,
24331 };
24332 #[cfg(feature = "arbitrary")]
24333 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24334 use arbitrary::{Arbitrary, Unstructured};
24335 let mut buf = [0u8; 1024];
24336 rng.fill_bytes(&mut buf);
24337 let mut unstructured = Unstructured::new(&buf);
24338 Self::arbitrary(&mut unstructured).unwrap_or_default()
24339 }
24340}
24341impl Default for PARAM_VALUE_DATA {
24342 fn default() -> Self {
24343 Self::DEFAULT.clone()
24344 }
24345}
24346impl MessageData for PARAM_VALUE_DATA {
24347 type Message = MavMessage;
24348 const ID: u32 = 22u32;
24349 const NAME: &'static str = "PARAM_VALUE";
24350 const EXTRA_CRC: u8 = 220u8;
24351 const ENCODED_LEN: usize = 25usize;
24352 fn deser(
24353 _version: MavlinkVersion,
24354 __input: &[u8],
24355 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24356 let avail_len = __input.len();
24357 let mut payload_buf = [0; Self::ENCODED_LEN];
24358 let mut buf = if avail_len < Self::ENCODED_LEN {
24359 payload_buf[0..avail_len].copy_from_slice(__input);
24360 Bytes::new(&payload_buf)
24361 } else {
24362 Bytes::new(__input)
24363 };
24364 let mut __struct = Self::default();
24365 __struct.param_value = buf.get_f32_le();
24366 __struct.param_count = buf.get_u16_le();
24367 __struct.param_index = buf.get_u16_le();
24368 for v in &mut __struct.param_id {
24369 let val = buf.get_u8();
24370 *v = val;
24371 }
24372 let tmp = buf.get_u8();
24373 __struct.param_type =
24374 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24375 enum_type: "MavParamType",
24376 value: tmp as u32,
24377 })?;
24378 Ok(__struct)
24379 }
24380 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24381 let mut __tmp = BytesMut::new(bytes);
24382 #[allow(clippy::absurd_extreme_comparisons)]
24383 #[allow(unused_comparisons)]
24384 if __tmp.remaining() < Self::ENCODED_LEN {
24385 panic!(
24386 "buffer is too small (need {} bytes, but got {})",
24387 Self::ENCODED_LEN,
24388 __tmp.remaining(),
24389 )
24390 }
24391 __tmp.put_f32_le(self.param_value);
24392 __tmp.put_u16_le(self.param_count);
24393 __tmp.put_u16_le(self.param_index);
24394 for val in &self.param_id {
24395 __tmp.put_u8(*val);
24396 }
24397 __tmp.put_u8(self.param_type as u8);
24398 if matches!(version, MavlinkVersion::V2) {
24399 let len = __tmp.len();
24400 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24401 } else {
24402 __tmp.len()
24403 }
24404 }
24405}
24406#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24407#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24408#[doc = ""]
24409#[doc = "ID: 4"]
24410#[derive(Debug, Clone, PartialEq)]
24411#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24412#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24413#[cfg_attr(feature = "ts", derive(TS))]
24414#[cfg_attr(feature = "ts", ts(export))]
24415pub struct PING_DATA {
24416 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24417 pub time_usec: u64,
24418 #[doc = "PING sequence"]
24419 pub seq: u32,
24420 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24421 pub target_system: u8,
24422 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24423 pub target_component: u8,
24424}
24425impl PING_DATA {
24426 pub const ENCODED_LEN: usize = 14usize;
24427 pub const DEFAULT: Self = Self {
24428 time_usec: 0_u64,
24429 seq: 0_u32,
24430 target_system: 0_u8,
24431 target_component: 0_u8,
24432 };
24433 #[cfg(feature = "arbitrary")]
24434 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24435 use arbitrary::{Arbitrary, Unstructured};
24436 let mut buf = [0u8; 1024];
24437 rng.fill_bytes(&mut buf);
24438 let mut unstructured = Unstructured::new(&buf);
24439 Self::arbitrary(&mut unstructured).unwrap_or_default()
24440 }
24441}
24442impl Default for PING_DATA {
24443 fn default() -> Self {
24444 Self::DEFAULT.clone()
24445 }
24446}
24447impl MessageData for PING_DATA {
24448 type Message = MavMessage;
24449 const ID: u32 = 4u32;
24450 const NAME: &'static str = "PING";
24451 const EXTRA_CRC: u8 = 237u8;
24452 const ENCODED_LEN: usize = 14usize;
24453 fn deser(
24454 _version: MavlinkVersion,
24455 __input: &[u8],
24456 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24457 let avail_len = __input.len();
24458 let mut payload_buf = [0; Self::ENCODED_LEN];
24459 let mut buf = if avail_len < Self::ENCODED_LEN {
24460 payload_buf[0..avail_len].copy_from_slice(__input);
24461 Bytes::new(&payload_buf)
24462 } else {
24463 Bytes::new(__input)
24464 };
24465 let mut __struct = Self::default();
24466 __struct.time_usec = buf.get_u64_le();
24467 __struct.seq = buf.get_u32_le();
24468 __struct.target_system = buf.get_u8();
24469 __struct.target_component = buf.get_u8();
24470 Ok(__struct)
24471 }
24472 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24473 let mut __tmp = BytesMut::new(bytes);
24474 #[allow(clippy::absurd_extreme_comparisons)]
24475 #[allow(unused_comparisons)]
24476 if __tmp.remaining() < Self::ENCODED_LEN {
24477 panic!(
24478 "buffer is too small (need {} bytes, but got {})",
24479 Self::ENCODED_LEN,
24480 __tmp.remaining(),
24481 )
24482 }
24483 __tmp.put_u64_le(self.time_usec);
24484 __tmp.put_u32_le(self.seq);
24485 __tmp.put_u8(self.target_system);
24486 __tmp.put_u8(self.target_component);
24487 if matches!(version, MavlinkVersion::V2) {
24488 let len = __tmp.len();
24489 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24490 } else {
24491 __tmp.len()
24492 }
24493 }
24494}
24495#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24496#[doc = "Control vehicle tone generation (buzzer)."]
24497#[doc = ""]
24498#[doc = "ID: 258"]
24499#[derive(Debug, Clone, PartialEq)]
24500#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24501#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24502#[cfg_attr(feature = "ts", derive(TS))]
24503#[cfg_attr(feature = "ts", ts(export))]
24504pub struct PLAY_TUNE_DATA {
24505 #[doc = "System ID"]
24506 pub target_system: u8,
24507 #[doc = "Component ID"]
24508 pub target_component: u8,
24509 #[doc = "tune in board specific format"]
24510 #[cfg_attr(
24511 feature = "serde",
24512 serde(
24513 serialize_with = "crate::nulstr::serialize::<_, 30>",
24514 deserialize_with = "crate::nulstr::deserialize::<_, 30>"
24515 )
24516 )]
24517 #[cfg_attr(feature = "ts", ts(type = "string"))]
24518 pub tune: [u8; 30],
24519 #[doc = "tune extension (appended to tune)"]
24520 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24521 #[cfg_attr(
24522 feature = "serde",
24523 serde(
24524 serialize_with = "crate::nulstr::serialize::<_, 200>",
24525 deserialize_with = "crate::nulstr::deserialize::<_, 200>"
24526 )
24527 )]
24528 #[cfg_attr(feature = "ts", ts(type = "string"))]
24529 pub tune2: [u8; 200],
24530}
24531impl PLAY_TUNE_DATA {
24532 pub const ENCODED_LEN: usize = 232usize;
24533 pub const DEFAULT: Self = Self {
24534 target_system: 0_u8,
24535 target_component: 0_u8,
24536 tune: [0_u8; 30usize],
24537 tune2: [0_u8; 200usize],
24538 };
24539 #[cfg(feature = "arbitrary")]
24540 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24541 use arbitrary::{Arbitrary, Unstructured};
24542 let mut buf = [0u8; 1024];
24543 rng.fill_bytes(&mut buf);
24544 let mut unstructured = Unstructured::new(&buf);
24545 Self::arbitrary(&mut unstructured).unwrap_or_default()
24546 }
24547}
24548impl Default for PLAY_TUNE_DATA {
24549 fn default() -> Self {
24550 Self::DEFAULT.clone()
24551 }
24552}
24553impl MessageData for PLAY_TUNE_DATA {
24554 type Message = MavMessage;
24555 const ID: u32 = 258u32;
24556 const NAME: &'static str = "PLAY_TUNE";
24557 const EXTRA_CRC: u8 = 187u8;
24558 const ENCODED_LEN: usize = 232usize;
24559 fn deser(
24560 _version: MavlinkVersion,
24561 __input: &[u8],
24562 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24563 let avail_len = __input.len();
24564 let mut payload_buf = [0; Self::ENCODED_LEN];
24565 let mut buf = if avail_len < Self::ENCODED_LEN {
24566 payload_buf[0..avail_len].copy_from_slice(__input);
24567 Bytes::new(&payload_buf)
24568 } else {
24569 Bytes::new(__input)
24570 };
24571 let mut __struct = Self::default();
24572 __struct.target_system = buf.get_u8();
24573 __struct.target_component = buf.get_u8();
24574 for v in &mut __struct.tune {
24575 let val = buf.get_u8();
24576 *v = val;
24577 }
24578 for v in &mut __struct.tune2 {
24579 let val = buf.get_u8();
24580 *v = val;
24581 }
24582 Ok(__struct)
24583 }
24584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24585 let mut __tmp = BytesMut::new(bytes);
24586 #[allow(clippy::absurd_extreme_comparisons)]
24587 #[allow(unused_comparisons)]
24588 if __tmp.remaining() < Self::ENCODED_LEN {
24589 panic!(
24590 "buffer is too small (need {} bytes, but got {})",
24591 Self::ENCODED_LEN,
24592 __tmp.remaining(),
24593 )
24594 }
24595 __tmp.put_u8(self.target_system);
24596 __tmp.put_u8(self.target_component);
24597 for val in &self.tune {
24598 __tmp.put_u8(*val);
24599 }
24600 if matches!(version, MavlinkVersion::V2) {
24601 for val in &self.tune2 {
24602 __tmp.put_u8(*val);
24603 }
24604 let len = __tmp.len();
24605 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24606 } else {
24607 __tmp.len()
24608 }
24609 }
24610}
24611#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24612#[doc = ""]
24613#[doc = "ID: 400"]
24614#[derive(Debug, Clone, PartialEq)]
24615#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24616#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24617#[cfg_attr(feature = "ts", derive(TS))]
24618#[cfg_attr(feature = "ts", ts(export))]
24619pub struct PLAY_TUNE_V2_DATA {
24620 #[doc = "Tune format"]
24621 pub format: TuneFormat,
24622 #[doc = "System ID"]
24623 pub target_system: u8,
24624 #[doc = "Component ID"]
24625 pub target_component: u8,
24626 #[doc = "Tune definition as a NULL-terminated string."]
24627 #[cfg_attr(
24628 feature = "serde",
24629 serde(
24630 serialize_with = "crate::nulstr::serialize::<_, 248>",
24631 deserialize_with = "crate::nulstr::deserialize::<_, 248>"
24632 )
24633 )]
24634 #[cfg_attr(feature = "ts", ts(type = "string"))]
24635 pub tune: [u8; 248],
24636}
24637impl PLAY_TUNE_V2_DATA {
24638 pub const ENCODED_LEN: usize = 254usize;
24639 pub const DEFAULT: Self = Self {
24640 format: TuneFormat::DEFAULT,
24641 target_system: 0_u8,
24642 target_component: 0_u8,
24643 tune: [0_u8; 248usize],
24644 };
24645 #[cfg(feature = "arbitrary")]
24646 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24647 use arbitrary::{Arbitrary, Unstructured};
24648 let mut buf = [0u8; 1024];
24649 rng.fill_bytes(&mut buf);
24650 let mut unstructured = Unstructured::new(&buf);
24651 Self::arbitrary(&mut unstructured).unwrap_or_default()
24652 }
24653}
24654impl Default for PLAY_TUNE_V2_DATA {
24655 fn default() -> Self {
24656 Self::DEFAULT.clone()
24657 }
24658}
24659impl MessageData for PLAY_TUNE_V2_DATA {
24660 type Message = MavMessage;
24661 const ID: u32 = 400u32;
24662 const NAME: &'static str = "PLAY_TUNE_V2";
24663 const EXTRA_CRC: u8 = 110u8;
24664 const ENCODED_LEN: usize = 254usize;
24665 fn deser(
24666 _version: MavlinkVersion,
24667 __input: &[u8],
24668 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24669 let avail_len = __input.len();
24670 let mut payload_buf = [0; Self::ENCODED_LEN];
24671 let mut buf = if avail_len < Self::ENCODED_LEN {
24672 payload_buf[0..avail_len].copy_from_slice(__input);
24673 Bytes::new(&payload_buf)
24674 } else {
24675 Bytes::new(__input)
24676 };
24677 let mut __struct = Self::default();
24678 let tmp = buf.get_u32_le();
24679 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24680 ::mavlink_core::error::ParserError::InvalidEnum {
24681 enum_type: "TuneFormat",
24682 value: tmp as u32,
24683 },
24684 )?;
24685 __struct.target_system = buf.get_u8();
24686 __struct.target_component = buf.get_u8();
24687 for v in &mut __struct.tune {
24688 let val = buf.get_u8();
24689 *v = val;
24690 }
24691 Ok(__struct)
24692 }
24693 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24694 let mut __tmp = BytesMut::new(bytes);
24695 #[allow(clippy::absurd_extreme_comparisons)]
24696 #[allow(unused_comparisons)]
24697 if __tmp.remaining() < Self::ENCODED_LEN {
24698 panic!(
24699 "buffer is too small (need {} bytes, but got {})",
24700 Self::ENCODED_LEN,
24701 __tmp.remaining(),
24702 )
24703 }
24704 __tmp.put_u32_le(self.format as u32);
24705 __tmp.put_u8(self.target_system);
24706 __tmp.put_u8(self.target_component);
24707 for val in &self.tune {
24708 __tmp.put_u8(*val);
24709 }
24710 if matches!(version, MavlinkVersion::V2) {
24711 let len = __tmp.len();
24712 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24713 } else {
24714 __tmp.len()
24715 }
24716 }
24717}
24718#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24719#[doc = ""]
24720#[doc = "ID: 87"]
24721#[derive(Debug, Clone, PartialEq)]
24722#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24723#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24724#[cfg_attr(feature = "ts", derive(TS))]
24725#[cfg_attr(feature = "ts", ts(export))]
24726pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24727 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24728 pub time_boot_ms: u32,
24729 #[doc = "Latitude in WGS84 frame"]
24730 pub lat_int: i32,
24731 #[doc = "Longitude in WGS84 frame"]
24732 pub lon_int: i32,
24733 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24734 pub alt: f32,
24735 #[doc = "X velocity in NED frame"]
24736 pub vx: f32,
24737 #[doc = "Y velocity in NED frame"]
24738 pub vy: f32,
24739 #[doc = "Z velocity in NED frame"]
24740 pub vz: f32,
24741 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24742 pub afx: f32,
24743 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24744 pub afy: f32,
24745 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24746 pub afz: f32,
24747 #[doc = "yaw setpoint"]
24748 pub yaw: f32,
24749 #[doc = "yaw rate setpoint"]
24750 pub yaw_rate: f32,
24751 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24752 pub type_mask: PositionTargetTypemask,
24753 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24754 pub coordinate_frame: MavFrame,
24755}
24756impl POSITION_TARGET_GLOBAL_INT_DATA {
24757 pub const ENCODED_LEN: usize = 51usize;
24758 pub const DEFAULT: Self = Self {
24759 time_boot_ms: 0_u32,
24760 lat_int: 0_i32,
24761 lon_int: 0_i32,
24762 alt: 0.0_f32,
24763 vx: 0.0_f32,
24764 vy: 0.0_f32,
24765 vz: 0.0_f32,
24766 afx: 0.0_f32,
24767 afy: 0.0_f32,
24768 afz: 0.0_f32,
24769 yaw: 0.0_f32,
24770 yaw_rate: 0.0_f32,
24771 type_mask: PositionTargetTypemask::DEFAULT,
24772 coordinate_frame: MavFrame::DEFAULT,
24773 };
24774 #[cfg(feature = "arbitrary")]
24775 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24776 use arbitrary::{Arbitrary, Unstructured};
24777 let mut buf = [0u8; 1024];
24778 rng.fill_bytes(&mut buf);
24779 let mut unstructured = Unstructured::new(&buf);
24780 Self::arbitrary(&mut unstructured).unwrap_or_default()
24781 }
24782}
24783impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24784 fn default() -> Self {
24785 Self::DEFAULT.clone()
24786 }
24787}
24788impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24789 type Message = MavMessage;
24790 const ID: u32 = 87u32;
24791 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24792 const EXTRA_CRC: u8 = 150u8;
24793 const ENCODED_LEN: usize = 51usize;
24794 fn deser(
24795 _version: MavlinkVersion,
24796 __input: &[u8],
24797 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24798 let avail_len = __input.len();
24799 let mut payload_buf = [0; Self::ENCODED_LEN];
24800 let mut buf = if avail_len < Self::ENCODED_LEN {
24801 payload_buf[0..avail_len].copy_from_slice(__input);
24802 Bytes::new(&payload_buf)
24803 } else {
24804 Bytes::new(__input)
24805 };
24806 let mut __struct = Self::default();
24807 __struct.time_boot_ms = buf.get_u32_le();
24808 __struct.lat_int = buf.get_i32_le();
24809 __struct.lon_int = buf.get_i32_le();
24810 __struct.alt = buf.get_f32_le();
24811 __struct.vx = buf.get_f32_le();
24812 __struct.vy = buf.get_f32_le();
24813 __struct.vz = buf.get_f32_le();
24814 __struct.afx = buf.get_f32_le();
24815 __struct.afy = buf.get_f32_le();
24816 __struct.afz = buf.get_f32_le();
24817 __struct.yaw = buf.get_f32_le();
24818 __struct.yaw_rate = buf.get_f32_le();
24819 let tmp = buf.get_u16_le();
24820 __struct.type_mask = PositionTargetTypemask::from_bits(
24821 tmp & PositionTargetTypemask::all().bits(),
24822 )
24823 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24824 flag_type: "PositionTargetTypemask",
24825 value: tmp as u32,
24826 })?;
24827 let tmp = buf.get_u8();
24828 __struct.coordinate_frame =
24829 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24830 enum_type: "MavFrame",
24831 value: tmp as u32,
24832 })?;
24833 Ok(__struct)
24834 }
24835 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24836 let mut __tmp = BytesMut::new(bytes);
24837 #[allow(clippy::absurd_extreme_comparisons)]
24838 #[allow(unused_comparisons)]
24839 if __tmp.remaining() < Self::ENCODED_LEN {
24840 panic!(
24841 "buffer is too small (need {} bytes, but got {})",
24842 Self::ENCODED_LEN,
24843 __tmp.remaining(),
24844 )
24845 }
24846 __tmp.put_u32_le(self.time_boot_ms);
24847 __tmp.put_i32_le(self.lat_int);
24848 __tmp.put_i32_le(self.lon_int);
24849 __tmp.put_f32_le(self.alt);
24850 __tmp.put_f32_le(self.vx);
24851 __tmp.put_f32_le(self.vy);
24852 __tmp.put_f32_le(self.vz);
24853 __tmp.put_f32_le(self.afx);
24854 __tmp.put_f32_le(self.afy);
24855 __tmp.put_f32_le(self.afz);
24856 __tmp.put_f32_le(self.yaw);
24857 __tmp.put_f32_le(self.yaw_rate);
24858 __tmp.put_u16_le(self.type_mask.bits());
24859 __tmp.put_u8(self.coordinate_frame as u8);
24860 if matches!(version, MavlinkVersion::V2) {
24861 let len = __tmp.len();
24862 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24863 } else {
24864 __tmp.len()
24865 }
24866 }
24867}
24868#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24869#[doc = ""]
24870#[doc = "ID: 85"]
24871#[derive(Debug, Clone, PartialEq)]
24872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24874#[cfg_attr(feature = "ts", derive(TS))]
24875#[cfg_attr(feature = "ts", ts(export))]
24876pub struct POSITION_TARGET_LOCAL_NED_DATA {
24877 #[doc = "Timestamp (time since system boot)."]
24878 pub time_boot_ms: u32,
24879 #[doc = "X Position in NED frame"]
24880 pub x: f32,
24881 #[doc = "Y Position in NED frame"]
24882 pub y: f32,
24883 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24884 pub z: f32,
24885 #[doc = "X velocity in NED frame"]
24886 pub vx: f32,
24887 #[doc = "Y velocity in NED frame"]
24888 pub vy: f32,
24889 #[doc = "Z velocity in NED frame"]
24890 pub vz: f32,
24891 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24892 pub afx: f32,
24893 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24894 pub afy: f32,
24895 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24896 pub afz: f32,
24897 #[doc = "yaw setpoint"]
24898 pub yaw: f32,
24899 #[doc = "yaw rate setpoint"]
24900 pub yaw_rate: f32,
24901 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24902 pub type_mask: PositionTargetTypemask,
24903 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24904 pub coordinate_frame: MavFrame,
24905}
24906impl POSITION_TARGET_LOCAL_NED_DATA {
24907 pub const ENCODED_LEN: usize = 51usize;
24908 pub const DEFAULT: Self = Self {
24909 time_boot_ms: 0_u32,
24910 x: 0.0_f32,
24911 y: 0.0_f32,
24912 z: 0.0_f32,
24913 vx: 0.0_f32,
24914 vy: 0.0_f32,
24915 vz: 0.0_f32,
24916 afx: 0.0_f32,
24917 afy: 0.0_f32,
24918 afz: 0.0_f32,
24919 yaw: 0.0_f32,
24920 yaw_rate: 0.0_f32,
24921 type_mask: PositionTargetTypemask::DEFAULT,
24922 coordinate_frame: MavFrame::DEFAULT,
24923 };
24924 #[cfg(feature = "arbitrary")]
24925 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24926 use arbitrary::{Arbitrary, Unstructured};
24927 let mut buf = [0u8; 1024];
24928 rng.fill_bytes(&mut buf);
24929 let mut unstructured = Unstructured::new(&buf);
24930 Self::arbitrary(&mut unstructured).unwrap_or_default()
24931 }
24932}
24933impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24934 fn default() -> Self {
24935 Self::DEFAULT.clone()
24936 }
24937}
24938impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24939 type Message = MavMessage;
24940 const ID: u32 = 85u32;
24941 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24942 const EXTRA_CRC: u8 = 140u8;
24943 const ENCODED_LEN: usize = 51usize;
24944 fn deser(
24945 _version: MavlinkVersion,
24946 __input: &[u8],
24947 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24948 let avail_len = __input.len();
24949 let mut payload_buf = [0; Self::ENCODED_LEN];
24950 let mut buf = if avail_len < Self::ENCODED_LEN {
24951 payload_buf[0..avail_len].copy_from_slice(__input);
24952 Bytes::new(&payload_buf)
24953 } else {
24954 Bytes::new(__input)
24955 };
24956 let mut __struct = Self::default();
24957 __struct.time_boot_ms = buf.get_u32_le();
24958 __struct.x = buf.get_f32_le();
24959 __struct.y = buf.get_f32_le();
24960 __struct.z = buf.get_f32_le();
24961 __struct.vx = buf.get_f32_le();
24962 __struct.vy = buf.get_f32_le();
24963 __struct.vz = buf.get_f32_le();
24964 __struct.afx = buf.get_f32_le();
24965 __struct.afy = buf.get_f32_le();
24966 __struct.afz = buf.get_f32_le();
24967 __struct.yaw = buf.get_f32_le();
24968 __struct.yaw_rate = buf.get_f32_le();
24969 let tmp = buf.get_u16_le();
24970 __struct.type_mask = PositionTargetTypemask::from_bits(
24971 tmp & PositionTargetTypemask::all().bits(),
24972 )
24973 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24974 flag_type: "PositionTargetTypemask",
24975 value: tmp as u32,
24976 })?;
24977 let tmp = buf.get_u8();
24978 __struct.coordinate_frame =
24979 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24980 enum_type: "MavFrame",
24981 value: tmp as u32,
24982 })?;
24983 Ok(__struct)
24984 }
24985 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24986 let mut __tmp = BytesMut::new(bytes);
24987 #[allow(clippy::absurd_extreme_comparisons)]
24988 #[allow(unused_comparisons)]
24989 if __tmp.remaining() < Self::ENCODED_LEN {
24990 panic!(
24991 "buffer is too small (need {} bytes, but got {})",
24992 Self::ENCODED_LEN,
24993 __tmp.remaining(),
24994 )
24995 }
24996 __tmp.put_u32_le(self.time_boot_ms);
24997 __tmp.put_f32_le(self.x);
24998 __tmp.put_f32_le(self.y);
24999 __tmp.put_f32_le(self.z);
25000 __tmp.put_f32_le(self.vx);
25001 __tmp.put_f32_le(self.vy);
25002 __tmp.put_f32_le(self.vz);
25003 __tmp.put_f32_le(self.afx);
25004 __tmp.put_f32_le(self.afy);
25005 __tmp.put_f32_le(self.afz);
25006 __tmp.put_f32_le(self.yaw);
25007 __tmp.put_f32_le(self.yaw_rate);
25008 __tmp.put_u16_le(self.type_mask.bits());
25009 __tmp.put_u8(self.coordinate_frame as u8);
25010 if matches!(version, MavlinkVersion::V2) {
25011 let len = __tmp.len();
25012 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25013 } else {
25014 __tmp.len()
25015 }
25016 }
25017}
25018#[doc = "Power supply status."]
25019#[doc = ""]
25020#[doc = "ID: 125"]
25021#[derive(Debug, Clone, PartialEq)]
25022#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25023#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25024#[cfg_attr(feature = "ts", derive(TS))]
25025#[cfg_attr(feature = "ts", ts(export))]
25026pub struct POWER_STATUS_DATA {
25027 #[doc = "5V rail voltage."]
25028 pub Vcc: u16,
25029 #[doc = "Servo rail voltage."]
25030 pub Vservo: u16,
25031 #[doc = "Bitmap of power supply status flags."]
25032 pub flags: MavPowerStatus,
25033}
25034impl POWER_STATUS_DATA {
25035 pub const ENCODED_LEN: usize = 6usize;
25036 pub const DEFAULT: Self = Self {
25037 Vcc: 0_u16,
25038 Vservo: 0_u16,
25039 flags: MavPowerStatus::DEFAULT,
25040 };
25041 #[cfg(feature = "arbitrary")]
25042 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25043 use arbitrary::{Arbitrary, Unstructured};
25044 let mut buf = [0u8; 1024];
25045 rng.fill_bytes(&mut buf);
25046 let mut unstructured = Unstructured::new(&buf);
25047 Self::arbitrary(&mut unstructured).unwrap_or_default()
25048 }
25049}
25050impl Default for POWER_STATUS_DATA {
25051 fn default() -> Self {
25052 Self::DEFAULT.clone()
25053 }
25054}
25055impl MessageData for POWER_STATUS_DATA {
25056 type Message = MavMessage;
25057 const ID: u32 = 125u32;
25058 const NAME: &'static str = "POWER_STATUS";
25059 const EXTRA_CRC: u8 = 203u8;
25060 const ENCODED_LEN: usize = 6usize;
25061 fn deser(
25062 _version: MavlinkVersion,
25063 __input: &[u8],
25064 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25065 let avail_len = __input.len();
25066 let mut payload_buf = [0; Self::ENCODED_LEN];
25067 let mut buf = if avail_len < Self::ENCODED_LEN {
25068 payload_buf[0..avail_len].copy_from_slice(__input);
25069 Bytes::new(&payload_buf)
25070 } else {
25071 Bytes::new(__input)
25072 };
25073 let mut __struct = Self::default();
25074 __struct.Vcc = buf.get_u16_le();
25075 __struct.Vservo = buf.get_u16_le();
25076 let tmp = buf.get_u16_le();
25077 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
25078 ::mavlink_core::error::ParserError::InvalidFlag {
25079 flag_type: "MavPowerStatus",
25080 value: tmp as u32,
25081 },
25082 )?;
25083 Ok(__struct)
25084 }
25085 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25086 let mut __tmp = BytesMut::new(bytes);
25087 #[allow(clippy::absurd_extreme_comparisons)]
25088 #[allow(unused_comparisons)]
25089 if __tmp.remaining() < Self::ENCODED_LEN {
25090 panic!(
25091 "buffer is too small (need {} bytes, but got {})",
25092 Self::ENCODED_LEN,
25093 __tmp.remaining(),
25094 )
25095 }
25096 __tmp.put_u16_le(self.Vcc);
25097 __tmp.put_u16_le(self.Vservo);
25098 __tmp.put_u16_le(self.flags.bits());
25099 if matches!(version, MavlinkVersion::V2) {
25100 let len = __tmp.len();
25101 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25102 } else {
25103 __tmp.len()
25104 }
25105 }
25106}
25107#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
25108#[doc = ""]
25109#[doc = "ID: 300"]
25110#[derive(Debug, Clone, PartialEq)]
25111#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25113#[cfg_attr(feature = "ts", derive(TS))]
25114#[cfg_attr(feature = "ts", ts(export))]
25115pub struct PROTOCOL_VERSION_DATA {
25116 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
25117 pub version: u16,
25118 #[doc = "Minimum MAVLink version supported"]
25119 pub min_version: u16,
25120 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
25121 pub max_version: u16,
25122 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25123 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25124 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25125 pub spec_version_hash: [u8; 8],
25126 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25127 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25128 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25129 pub library_version_hash: [u8; 8],
25130}
25131impl PROTOCOL_VERSION_DATA {
25132 pub const ENCODED_LEN: usize = 22usize;
25133 pub const DEFAULT: Self = Self {
25134 version: 0_u16,
25135 min_version: 0_u16,
25136 max_version: 0_u16,
25137 spec_version_hash: [0_u8; 8usize],
25138 library_version_hash: [0_u8; 8usize],
25139 };
25140 #[cfg(feature = "arbitrary")]
25141 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25142 use arbitrary::{Arbitrary, Unstructured};
25143 let mut buf = [0u8; 1024];
25144 rng.fill_bytes(&mut buf);
25145 let mut unstructured = Unstructured::new(&buf);
25146 Self::arbitrary(&mut unstructured).unwrap_or_default()
25147 }
25148}
25149impl Default for PROTOCOL_VERSION_DATA {
25150 fn default() -> Self {
25151 Self::DEFAULT.clone()
25152 }
25153}
25154impl MessageData for PROTOCOL_VERSION_DATA {
25155 type Message = MavMessage;
25156 const ID: u32 = 300u32;
25157 const NAME: &'static str = "PROTOCOL_VERSION";
25158 const EXTRA_CRC: u8 = 217u8;
25159 const ENCODED_LEN: usize = 22usize;
25160 fn deser(
25161 _version: MavlinkVersion,
25162 __input: &[u8],
25163 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25164 let avail_len = __input.len();
25165 let mut payload_buf = [0; Self::ENCODED_LEN];
25166 let mut buf = if avail_len < Self::ENCODED_LEN {
25167 payload_buf[0..avail_len].copy_from_slice(__input);
25168 Bytes::new(&payload_buf)
25169 } else {
25170 Bytes::new(__input)
25171 };
25172 let mut __struct = Self::default();
25173 __struct.version = buf.get_u16_le();
25174 __struct.min_version = buf.get_u16_le();
25175 __struct.max_version = buf.get_u16_le();
25176 for v in &mut __struct.spec_version_hash {
25177 let val = buf.get_u8();
25178 *v = val;
25179 }
25180 for v in &mut __struct.library_version_hash {
25181 let val = buf.get_u8();
25182 *v = val;
25183 }
25184 Ok(__struct)
25185 }
25186 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25187 let mut __tmp = BytesMut::new(bytes);
25188 #[allow(clippy::absurd_extreme_comparisons)]
25189 #[allow(unused_comparisons)]
25190 if __tmp.remaining() < Self::ENCODED_LEN {
25191 panic!(
25192 "buffer is too small (need {} bytes, but got {})",
25193 Self::ENCODED_LEN,
25194 __tmp.remaining(),
25195 )
25196 }
25197 __tmp.put_u16_le(self.version);
25198 __tmp.put_u16_le(self.min_version);
25199 __tmp.put_u16_le(self.max_version);
25200 for val in &self.spec_version_hash {
25201 __tmp.put_u8(*val);
25202 }
25203 for val in &self.library_version_hash {
25204 __tmp.put_u8(*val);
25205 }
25206 if matches!(version, MavlinkVersion::V2) {
25207 let len = __tmp.len();
25208 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25209 } else {
25210 __tmp.len()
25211 }
25212 }
25213}
25214#[doc = "Complete set of calibration parameters for the radio."]
25215#[doc = ""]
25216#[doc = "ID: 221"]
25217#[derive(Debug, Clone, PartialEq)]
25218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25219#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25220#[cfg_attr(feature = "ts", derive(TS))]
25221#[cfg_attr(feature = "ts", ts(export))]
25222pub struct RADIO_CALIBRATION_DATA {
25223 #[doc = "Aileron setpoints: left, center, right"]
25224 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25225 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25226 pub aileron: [u16; 3],
25227 #[doc = "Elevator setpoints: nose down, center, nose up"]
25228 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25229 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25230 pub elevator: [u16; 3],
25231 #[doc = "Rudder setpoints: nose left, center, nose right"]
25232 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25233 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25234 pub rudder: [u16; 3],
25235 #[doc = "Tail gyro mode/gain setpoints: heading hold, rate mode"]
25236 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25237 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25238 pub gyro: [u16; 2],
25239 #[doc = "Pitch curve setpoints (every 25%)"]
25240 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25241 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25242 pub pitch: [u16; 5],
25243 #[doc = "Throttle curve setpoints (every 25%)"]
25244 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25245 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25246 pub throttle: [u16; 5],
25247}
25248impl RADIO_CALIBRATION_DATA {
25249 pub const ENCODED_LEN: usize = 42usize;
25250 pub const DEFAULT: Self = Self {
25251 aileron: [0_u16; 3usize],
25252 elevator: [0_u16; 3usize],
25253 rudder: [0_u16; 3usize],
25254 gyro: [0_u16; 2usize],
25255 pitch: [0_u16; 5usize],
25256 throttle: [0_u16; 5usize],
25257 };
25258 #[cfg(feature = "arbitrary")]
25259 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25260 use arbitrary::{Arbitrary, Unstructured};
25261 let mut buf = [0u8; 1024];
25262 rng.fill_bytes(&mut buf);
25263 let mut unstructured = Unstructured::new(&buf);
25264 Self::arbitrary(&mut unstructured).unwrap_or_default()
25265 }
25266}
25267impl Default for RADIO_CALIBRATION_DATA {
25268 fn default() -> Self {
25269 Self::DEFAULT.clone()
25270 }
25271}
25272impl MessageData for RADIO_CALIBRATION_DATA {
25273 type Message = MavMessage;
25274 const ID: u32 = 221u32;
25275 const NAME: &'static str = "RADIO_CALIBRATION";
25276 const EXTRA_CRC: u8 = 71u8;
25277 const ENCODED_LEN: usize = 42usize;
25278 fn deser(
25279 _version: MavlinkVersion,
25280 __input: &[u8],
25281 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25282 let avail_len = __input.len();
25283 let mut payload_buf = [0; Self::ENCODED_LEN];
25284 let mut buf = if avail_len < Self::ENCODED_LEN {
25285 payload_buf[0..avail_len].copy_from_slice(__input);
25286 Bytes::new(&payload_buf)
25287 } else {
25288 Bytes::new(__input)
25289 };
25290 let mut __struct = Self::default();
25291 for v in &mut __struct.aileron {
25292 let val = buf.get_u16_le();
25293 *v = val;
25294 }
25295 for v in &mut __struct.elevator {
25296 let val = buf.get_u16_le();
25297 *v = val;
25298 }
25299 for v in &mut __struct.rudder {
25300 let val = buf.get_u16_le();
25301 *v = val;
25302 }
25303 for v in &mut __struct.gyro {
25304 let val = buf.get_u16_le();
25305 *v = val;
25306 }
25307 for v in &mut __struct.pitch {
25308 let val = buf.get_u16_le();
25309 *v = val;
25310 }
25311 for v in &mut __struct.throttle {
25312 let val = buf.get_u16_le();
25313 *v = val;
25314 }
25315 Ok(__struct)
25316 }
25317 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25318 let mut __tmp = BytesMut::new(bytes);
25319 #[allow(clippy::absurd_extreme_comparisons)]
25320 #[allow(unused_comparisons)]
25321 if __tmp.remaining() < Self::ENCODED_LEN {
25322 panic!(
25323 "buffer is too small (need {} bytes, but got {})",
25324 Self::ENCODED_LEN,
25325 __tmp.remaining(),
25326 )
25327 }
25328 for val in &self.aileron {
25329 __tmp.put_u16_le(*val);
25330 }
25331 for val in &self.elevator {
25332 __tmp.put_u16_le(*val);
25333 }
25334 for val in &self.rudder {
25335 __tmp.put_u16_le(*val);
25336 }
25337 for val in &self.gyro {
25338 __tmp.put_u16_le(*val);
25339 }
25340 for val in &self.pitch {
25341 __tmp.put_u16_le(*val);
25342 }
25343 for val in &self.throttle {
25344 __tmp.put_u16_le(*val);
25345 }
25346 if matches!(version, MavlinkVersion::V2) {
25347 let len = __tmp.len();
25348 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25349 } else {
25350 __tmp.len()
25351 }
25352 }
25353}
25354#[doc = "Status generated by radio and injected into MAVLink stream."]
25355#[doc = ""]
25356#[doc = "ID: 109"]
25357#[derive(Debug, Clone, PartialEq)]
25358#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25360#[cfg_attr(feature = "ts", derive(TS))]
25361#[cfg_attr(feature = "ts", ts(export))]
25362pub struct RADIO_STATUS_DATA {
25363 #[doc = "Count of radio packet receive errors (since boot)."]
25364 pub rxerrors: u16,
25365 #[doc = "Count of error corrected radio packets (since boot)."]
25366 pub fixed: u16,
25367 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25368 pub rssi: u8,
25369 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25370 pub remrssi: u8,
25371 #[doc = "Remaining free transmitter buffer space."]
25372 pub txbuf: u8,
25373 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25374 pub noise: u8,
25375 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25376 pub remnoise: u8,
25377}
25378impl RADIO_STATUS_DATA {
25379 pub const ENCODED_LEN: usize = 9usize;
25380 pub const DEFAULT: Self = Self {
25381 rxerrors: 0_u16,
25382 fixed: 0_u16,
25383 rssi: 0_u8,
25384 remrssi: 0_u8,
25385 txbuf: 0_u8,
25386 noise: 0_u8,
25387 remnoise: 0_u8,
25388 };
25389 #[cfg(feature = "arbitrary")]
25390 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25391 use arbitrary::{Arbitrary, Unstructured};
25392 let mut buf = [0u8; 1024];
25393 rng.fill_bytes(&mut buf);
25394 let mut unstructured = Unstructured::new(&buf);
25395 Self::arbitrary(&mut unstructured).unwrap_or_default()
25396 }
25397}
25398impl Default for RADIO_STATUS_DATA {
25399 fn default() -> Self {
25400 Self::DEFAULT.clone()
25401 }
25402}
25403impl MessageData for RADIO_STATUS_DATA {
25404 type Message = MavMessage;
25405 const ID: u32 = 109u32;
25406 const NAME: &'static str = "RADIO_STATUS";
25407 const EXTRA_CRC: u8 = 185u8;
25408 const ENCODED_LEN: usize = 9usize;
25409 fn deser(
25410 _version: MavlinkVersion,
25411 __input: &[u8],
25412 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25413 let avail_len = __input.len();
25414 let mut payload_buf = [0; Self::ENCODED_LEN];
25415 let mut buf = if avail_len < Self::ENCODED_LEN {
25416 payload_buf[0..avail_len].copy_from_slice(__input);
25417 Bytes::new(&payload_buf)
25418 } else {
25419 Bytes::new(__input)
25420 };
25421 let mut __struct = Self::default();
25422 __struct.rxerrors = buf.get_u16_le();
25423 __struct.fixed = buf.get_u16_le();
25424 __struct.rssi = buf.get_u8();
25425 __struct.remrssi = buf.get_u8();
25426 __struct.txbuf = buf.get_u8();
25427 __struct.noise = buf.get_u8();
25428 __struct.remnoise = buf.get_u8();
25429 Ok(__struct)
25430 }
25431 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25432 let mut __tmp = BytesMut::new(bytes);
25433 #[allow(clippy::absurd_extreme_comparisons)]
25434 #[allow(unused_comparisons)]
25435 if __tmp.remaining() < Self::ENCODED_LEN {
25436 panic!(
25437 "buffer is too small (need {} bytes, but got {})",
25438 Self::ENCODED_LEN,
25439 __tmp.remaining(),
25440 )
25441 }
25442 __tmp.put_u16_le(self.rxerrors);
25443 __tmp.put_u16_le(self.fixed);
25444 __tmp.put_u8(self.rssi);
25445 __tmp.put_u8(self.remrssi);
25446 __tmp.put_u8(self.txbuf);
25447 __tmp.put_u8(self.noise);
25448 __tmp.put_u8(self.remnoise);
25449 if matches!(version, MavlinkVersion::V2) {
25450 let len = __tmp.len();
25451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25452 } else {
25453 __tmp.len()
25454 }
25455 }
25456}
25457#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25458#[doc = ""]
25459#[doc = "ID: 27"]
25460#[derive(Debug, Clone, PartialEq)]
25461#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25462#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25463#[cfg_attr(feature = "ts", derive(TS))]
25464#[cfg_attr(feature = "ts", ts(export))]
25465pub struct RAW_IMU_DATA {
25466 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25467 pub time_usec: u64,
25468 #[doc = "X acceleration (raw)"]
25469 pub xacc: i16,
25470 #[doc = "Y acceleration (raw)"]
25471 pub yacc: i16,
25472 #[doc = "Z acceleration (raw)"]
25473 pub zacc: i16,
25474 #[doc = "Angular speed around X axis (raw)"]
25475 pub xgyro: i16,
25476 #[doc = "Angular speed around Y axis (raw)"]
25477 pub ygyro: i16,
25478 #[doc = "Angular speed around Z axis (raw)"]
25479 pub zgyro: i16,
25480 #[doc = "X Magnetic field (raw)"]
25481 pub xmag: i16,
25482 #[doc = "Y Magnetic field (raw)"]
25483 pub ymag: i16,
25484 #[doc = "Z Magnetic field (raw)"]
25485 pub zmag: i16,
25486 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25487 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25488 pub id: u8,
25489 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25490 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25491 pub temperature: i16,
25492}
25493impl RAW_IMU_DATA {
25494 pub const ENCODED_LEN: usize = 29usize;
25495 pub const DEFAULT: Self = Self {
25496 time_usec: 0_u64,
25497 xacc: 0_i16,
25498 yacc: 0_i16,
25499 zacc: 0_i16,
25500 xgyro: 0_i16,
25501 ygyro: 0_i16,
25502 zgyro: 0_i16,
25503 xmag: 0_i16,
25504 ymag: 0_i16,
25505 zmag: 0_i16,
25506 id: 0_u8,
25507 temperature: 0_i16,
25508 };
25509 #[cfg(feature = "arbitrary")]
25510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25511 use arbitrary::{Arbitrary, Unstructured};
25512 let mut buf = [0u8; 1024];
25513 rng.fill_bytes(&mut buf);
25514 let mut unstructured = Unstructured::new(&buf);
25515 Self::arbitrary(&mut unstructured).unwrap_or_default()
25516 }
25517}
25518impl Default for RAW_IMU_DATA {
25519 fn default() -> Self {
25520 Self::DEFAULT.clone()
25521 }
25522}
25523impl MessageData for RAW_IMU_DATA {
25524 type Message = MavMessage;
25525 const ID: u32 = 27u32;
25526 const NAME: &'static str = "RAW_IMU";
25527 const EXTRA_CRC: u8 = 144u8;
25528 const ENCODED_LEN: usize = 29usize;
25529 fn deser(
25530 _version: MavlinkVersion,
25531 __input: &[u8],
25532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25533 let avail_len = __input.len();
25534 let mut payload_buf = [0; Self::ENCODED_LEN];
25535 let mut buf = if avail_len < Self::ENCODED_LEN {
25536 payload_buf[0..avail_len].copy_from_slice(__input);
25537 Bytes::new(&payload_buf)
25538 } else {
25539 Bytes::new(__input)
25540 };
25541 let mut __struct = Self::default();
25542 __struct.time_usec = buf.get_u64_le();
25543 __struct.xacc = buf.get_i16_le();
25544 __struct.yacc = buf.get_i16_le();
25545 __struct.zacc = buf.get_i16_le();
25546 __struct.xgyro = buf.get_i16_le();
25547 __struct.ygyro = buf.get_i16_le();
25548 __struct.zgyro = buf.get_i16_le();
25549 __struct.xmag = buf.get_i16_le();
25550 __struct.ymag = buf.get_i16_le();
25551 __struct.zmag = buf.get_i16_le();
25552 __struct.id = buf.get_u8();
25553 __struct.temperature = buf.get_i16_le();
25554 Ok(__struct)
25555 }
25556 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25557 let mut __tmp = BytesMut::new(bytes);
25558 #[allow(clippy::absurd_extreme_comparisons)]
25559 #[allow(unused_comparisons)]
25560 if __tmp.remaining() < Self::ENCODED_LEN {
25561 panic!(
25562 "buffer is too small (need {} bytes, but got {})",
25563 Self::ENCODED_LEN,
25564 __tmp.remaining(),
25565 )
25566 }
25567 __tmp.put_u64_le(self.time_usec);
25568 __tmp.put_i16_le(self.xacc);
25569 __tmp.put_i16_le(self.yacc);
25570 __tmp.put_i16_le(self.zacc);
25571 __tmp.put_i16_le(self.xgyro);
25572 __tmp.put_i16_le(self.ygyro);
25573 __tmp.put_i16_le(self.zgyro);
25574 __tmp.put_i16_le(self.xmag);
25575 __tmp.put_i16_le(self.ymag);
25576 __tmp.put_i16_le(self.zmag);
25577 if matches!(version, MavlinkVersion::V2) {
25578 __tmp.put_u8(self.id);
25579 __tmp.put_i16_le(self.temperature);
25580 let len = __tmp.len();
25581 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25582 } else {
25583 __tmp.len()
25584 }
25585 }
25586}
25587#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25588#[doc = ""]
25589#[doc = "ID: 28"]
25590#[derive(Debug, Clone, PartialEq)]
25591#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25592#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25593#[cfg_attr(feature = "ts", derive(TS))]
25594#[cfg_attr(feature = "ts", ts(export))]
25595pub struct RAW_PRESSURE_DATA {
25596 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25597 pub time_usec: u64,
25598 #[doc = "Absolute pressure (raw)"]
25599 pub press_abs: i16,
25600 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25601 pub press_diff1: i16,
25602 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25603 pub press_diff2: i16,
25604 #[doc = "Raw Temperature measurement (raw)"]
25605 pub temperature: i16,
25606}
25607impl RAW_PRESSURE_DATA {
25608 pub const ENCODED_LEN: usize = 16usize;
25609 pub const DEFAULT: Self = Self {
25610 time_usec: 0_u64,
25611 press_abs: 0_i16,
25612 press_diff1: 0_i16,
25613 press_diff2: 0_i16,
25614 temperature: 0_i16,
25615 };
25616 #[cfg(feature = "arbitrary")]
25617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25618 use arbitrary::{Arbitrary, Unstructured};
25619 let mut buf = [0u8; 1024];
25620 rng.fill_bytes(&mut buf);
25621 let mut unstructured = Unstructured::new(&buf);
25622 Self::arbitrary(&mut unstructured).unwrap_or_default()
25623 }
25624}
25625impl Default for RAW_PRESSURE_DATA {
25626 fn default() -> Self {
25627 Self::DEFAULT.clone()
25628 }
25629}
25630impl MessageData for RAW_PRESSURE_DATA {
25631 type Message = MavMessage;
25632 const ID: u32 = 28u32;
25633 const NAME: &'static str = "RAW_PRESSURE";
25634 const EXTRA_CRC: u8 = 67u8;
25635 const ENCODED_LEN: usize = 16usize;
25636 fn deser(
25637 _version: MavlinkVersion,
25638 __input: &[u8],
25639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25640 let avail_len = __input.len();
25641 let mut payload_buf = [0; Self::ENCODED_LEN];
25642 let mut buf = if avail_len < Self::ENCODED_LEN {
25643 payload_buf[0..avail_len].copy_from_slice(__input);
25644 Bytes::new(&payload_buf)
25645 } else {
25646 Bytes::new(__input)
25647 };
25648 let mut __struct = Self::default();
25649 __struct.time_usec = buf.get_u64_le();
25650 __struct.press_abs = buf.get_i16_le();
25651 __struct.press_diff1 = buf.get_i16_le();
25652 __struct.press_diff2 = buf.get_i16_le();
25653 __struct.temperature = buf.get_i16_le();
25654 Ok(__struct)
25655 }
25656 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25657 let mut __tmp = BytesMut::new(bytes);
25658 #[allow(clippy::absurd_extreme_comparisons)]
25659 #[allow(unused_comparisons)]
25660 if __tmp.remaining() < Self::ENCODED_LEN {
25661 panic!(
25662 "buffer is too small (need {} bytes, but got {})",
25663 Self::ENCODED_LEN,
25664 __tmp.remaining(),
25665 )
25666 }
25667 __tmp.put_u64_le(self.time_usec);
25668 __tmp.put_i16_le(self.press_abs);
25669 __tmp.put_i16_le(self.press_diff1);
25670 __tmp.put_i16_le(self.press_diff2);
25671 __tmp.put_i16_le(self.temperature);
25672 if matches!(version, MavlinkVersion::V2) {
25673 let len = __tmp.len();
25674 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25675 } else {
25676 __tmp.len()
25677 }
25678 }
25679}
25680#[doc = "RPM sensor data message."]
25681#[doc = ""]
25682#[doc = "ID: 339"]
25683#[derive(Debug, Clone, PartialEq)]
25684#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25685#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25686#[cfg_attr(feature = "ts", derive(TS))]
25687#[cfg_attr(feature = "ts", ts(export))]
25688pub struct RAW_RPM_DATA {
25689 #[doc = "Indicated rate"]
25690 pub frequency: f32,
25691 #[doc = "Index of this RPM sensor (0-indexed)"]
25692 pub index: u8,
25693}
25694impl RAW_RPM_DATA {
25695 pub const ENCODED_LEN: usize = 5usize;
25696 pub const DEFAULT: Self = Self {
25697 frequency: 0.0_f32,
25698 index: 0_u8,
25699 };
25700 #[cfg(feature = "arbitrary")]
25701 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25702 use arbitrary::{Arbitrary, Unstructured};
25703 let mut buf = [0u8; 1024];
25704 rng.fill_bytes(&mut buf);
25705 let mut unstructured = Unstructured::new(&buf);
25706 Self::arbitrary(&mut unstructured).unwrap_or_default()
25707 }
25708}
25709impl Default for RAW_RPM_DATA {
25710 fn default() -> Self {
25711 Self::DEFAULT.clone()
25712 }
25713}
25714impl MessageData for RAW_RPM_DATA {
25715 type Message = MavMessage;
25716 const ID: u32 = 339u32;
25717 const NAME: &'static str = "RAW_RPM";
25718 const EXTRA_CRC: u8 = 199u8;
25719 const ENCODED_LEN: usize = 5usize;
25720 fn deser(
25721 _version: MavlinkVersion,
25722 __input: &[u8],
25723 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25724 let avail_len = __input.len();
25725 let mut payload_buf = [0; Self::ENCODED_LEN];
25726 let mut buf = if avail_len < Self::ENCODED_LEN {
25727 payload_buf[0..avail_len].copy_from_slice(__input);
25728 Bytes::new(&payload_buf)
25729 } else {
25730 Bytes::new(__input)
25731 };
25732 let mut __struct = Self::default();
25733 __struct.frequency = buf.get_f32_le();
25734 __struct.index = buf.get_u8();
25735 Ok(__struct)
25736 }
25737 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25738 let mut __tmp = BytesMut::new(bytes);
25739 #[allow(clippy::absurd_extreme_comparisons)]
25740 #[allow(unused_comparisons)]
25741 if __tmp.remaining() < Self::ENCODED_LEN {
25742 panic!(
25743 "buffer is too small (need {} bytes, but got {})",
25744 Self::ENCODED_LEN,
25745 __tmp.remaining(),
25746 )
25747 }
25748 __tmp.put_f32_le(self.frequency);
25749 __tmp.put_u8(self.index);
25750 if matches!(version, MavlinkVersion::V2) {
25751 let len = __tmp.len();
25752 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25753 } else {
25754 __tmp.len()
25755 }
25756 }
25757}
25758#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25759#[doc = ""]
25760#[doc = "ID: 65"]
25761#[derive(Debug, Clone, PartialEq)]
25762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25764#[cfg_attr(feature = "ts", derive(TS))]
25765#[cfg_attr(feature = "ts", ts(export))]
25766pub struct RC_CHANNELS_DATA {
25767 #[doc = "Timestamp (time since system boot)."]
25768 pub time_boot_ms: u32,
25769 #[doc = "RC channel 1 value."]
25770 pub chan1_raw: u16,
25771 #[doc = "RC channel 2 value."]
25772 pub chan2_raw: u16,
25773 #[doc = "RC channel 3 value."]
25774 pub chan3_raw: u16,
25775 #[doc = "RC channel 4 value."]
25776 pub chan4_raw: u16,
25777 #[doc = "RC channel 5 value."]
25778 pub chan5_raw: u16,
25779 #[doc = "RC channel 6 value."]
25780 pub chan6_raw: u16,
25781 #[doc = "RC channel 7 value."]
25782 pub chan7_raw: u16,
25783 #[doc = "RC channel 8 value."]
25784 pub chan8_raw: u16,
25785 #[doc = "RC channel 9 value."]
25786 pub chan9_raw: u16,
25787 #[doc = "RC channel 10 value."]
25788 pub chan10_raw: u16,
25789 #[doc = "RC channel 11 value."]
25790 pub chan11_raw: u16,
25791 #[doc = "RC channel 12 value."]
25792 pub chan12_raw: u16,
25793 #[doc = "RC channel 13 value."]
25794 pub chan13_raw: u16,
25795 #[doc = "RC channel 14 value."]
25796 pub chan14_raw: u16,
25797 #[doc = "RC channel 15 value."]
25798 pub chan15_raw: u16,
25799 #[doc = "RC channel 16 value."]
25800 pub chan16_raw: u16,
25801 #[doc = "RC channel 17 value."]
25802 pub chan17_raw: u16,
25803 #[doc = "RC channel 18 value."]
25804 pub chan18_raw: u16,
25805 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25806 pub chancount: u8,
25807 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25808 pub rssi: u8,
25809}
25810impl RC_CHANNELS_DATA {
25811 pub const ENCODED_LEN: usize = 42usize;
25812 pub const DEFAULT: Self = Self {
25813 time_boot_ms: 0_u32,
25814 chan1_raw: 0_u16,
25815 chan2_raw: 0_u16,
25816 chan3_raw: 0_u16,
25817 chan4_raw: 0_u16,
25818 chan5_raw: 0_u16,
25819 chan6_raw: 0_u16,
25820 chan7_raw: 0_u16,
25821 chan8_raw: 0_u16,
25822 chan9_raw: 0_u16,
25823 chan10_raw: 0_u16,
25824 chan11_raw: 0_u16,
25825 chan12_raw: 0_u16,
25826 chan13_raw: 0_u16,
25827 chan14_raw: 0_u16,
25828 chan15_raw: 0_u16,
25829 chan16_raw: 0_u16,
25830 chan17_raw: 0_u16,
25831 chan18_raw: 0_u16,
25832 chancount: 0_u8,
25833 rssi: 0_u8,
25834 };
25835 #[cfg(feature = "arbitrary")]
25836 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25837 use arbitrary::{Arbitrary, Unstructured};
25838 let mut buf = [0u8; 1024];
25839 rng.fill_bytes(&mut buf);
25840 let mut unstructured = Unstructured::new(&buf);
25841 Self::arbitrary(&mut unstructured).unwrap_or_default()
25842 }
25843}
25844impl Default for RC_CHANNELS_DATA {
25845 fn default() -> Self {
25846 Self::DEFAULT.clone()
25847 }
25848}
25849impl MessageData for RC_CHANNELS_DATA {
25850 type Message = MavMessage;
25851 const ID: u32 = 65u32;
25852 const NAME: &'static str = "RC_CHANNELS";
25853 const EXTRA_CRC: u8 = 118u8;
25854 const ENCODED_LEN: usize = 42usize;
25855 fn deser(
25856 _version: MavlinkVersion,
25857 __input: &[u8],
25858 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25859 let avail_len = __input.len();
25860 let mut payload_buf = [0; Self::ENCODED_LEN];
25861 let mut buf = if avail_len < Self::ENCODED_LEN {
25862 payload_buf[0..avail_len].copy_from_slice(__input);
25863 Bytes::new(&payload_buf)
25864 } else {
25865 Bytes::new(__input)
25866 };
25867 let mut __struct = Self::default();
25868 __struct.time_boot_ms = buf.get_u32_le();
25869 __struct.chan1_raw = buf.get_u16_le();
25870 __struct.chan2_raw = buf.get_u16_le();
25871 __struct.chan3_raw = buf.get_u16_le();
25872 __struct.chan4_raw = buf.get_u16_le();
25873 __struct.chan5_raw = buf.get_u16_le();
25874 __struct.chan6_raw = buf.get_u16_le();
25875 __struct.chan7_raw = buf.get_u16_le();
25876 __struct.chan8_raw = buf.get_u16_le();
25877 __struct.chan9_raw = buf.get_u16_le();
25878 __struct.chan10_raw = buf.get_u16_le();
25879 __struct.chan11_raw = buf.get_u16_le();
25880 __struct.chan12_raw = buf.get_u16_le();
25881 __struct.chan13_raw = buf.get_u16_le();
25882 __struct.chan14_raw = buf.get_u16_le();
25883 __struct.chan15_raw = buf.get_u16_le();
25884 __struct.chan16_raw = buf.get_u16_le();
25885 __struct.chan17_raw = buf.get_u16_le();
25886 __struct.chan18_raw = buf.get_u16_le();
25887 __struct.chancount = buf.get_u8();
25888 __struct.rssi = buf.get_u8();
25889 Ok(__struct)
25890 }
25891 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25892 let mut __tmp = BytesMut::new(bytes);
25893 #[allow(clippy::absurd_extreme_comparisons)]
25894 #[allow(unused_comparisons)]
25895 if __tmp.remaining() < Self::ENCODED_LEN {
25896 panic!(
25897 "buffer is too small (need {} bytes, but got {})",
25898 Self::ENCODED_LEN,
25899 __tmp.remaining(),
25900 )
25901 }
25902 __tmp.put_u32_le(self.time_boot_ms);
25903 __tmp.put_u16_le(self.chan1_raw);
25904 __tmp.put_u16_le(self.chan2_raw);
25905 __tmp.put_u16_le(self.chan3_raw);
25906 __tmp.put_u16_le(self.chan4_raw);
25907 __tmp.put_u16_le(self.chan5_raw);
25908 __tmp.put_u16_le(self.chan6_raw);
25909 __tmp.put_u16_le(self.chan7_raw);
25910 __tmp.put_u16_le(self.chan8_raw);
25911 __tmp.put_u16_le(self.chan9_raw);
25912 __tmp.put_u16_le(self.chan10_raw);
25913 __tmp.put_u16_le(self.chan11_raw);
25914 __tmp.put_u16_le(self.chan12_raw);
25915 __tmp.put_u16_le(self.chan13_raw);
25916 __tmp.put_u16_le(self.chan14_raw);
25917 __tmp.put_u16_le(self.chan15_raw);
25918 __tmp.put_u16_le(self.chan16_raw);
25919 __tmp.put_u16_le(self.chan17_raw);
25920 __tmp.put_u16_le(self.chan18_raw);
25921 __tmp.put_u8(self.chancount);
25922 __tmp.put_u8(self.rssi);
25923 if matches!(version, MavlinkVersion::V2) {
25924 let len = __tmp.len();
25925 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25926 } else {
25927 __tmp.len()
25928 }
25929 }
25930}
25931#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25932#[doc = ""]
25933#[doc = "ID: 70"]
25934#[derive(Debug, Clone, PartialEq)]
25935#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25936#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25937#[cfg_attr(feature = "ts", derive(TS))]
25938#[cfg_attr(feature = "ts", ts(export))]
25939pub struct RC_CHANNELS_OVERRIDE_DATA {
25940 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25941 pub chan1_raw: u16,
25942 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25943 pub chan2_raw: u16,
25944 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25945 pub chan3_raw: u16,
25946 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25947 pub chan4_raw: u16,
25948 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25949 pub chan5_raw: u16,
25950 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25951 pub chan6_raw: u16,
25952 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25953 pub chan7_raw: u16,
25954 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25955 pub chan8_raw: u16,
25956 #[doc = "System ID"]
25957 pub target_system: u8,
25958 #[doc = "Component ID"]
25959 pub target_component: u8,
25960 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25961 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25962 pub chan9_raw: u16,
25963 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25964 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25965 pub chan10_raw: u16,
25966 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25967 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25968 pub chan11_raw: u16,
25969 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25970 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25971 pub chan12_raw: u16,
25972 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25973 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25974 pub chan13_raw: u16,
25975 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25976 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25977 pub chan14_raw: u16,
25978 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25979 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25980 pub chan15_raw: u16,
25981 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25982 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25983 pub chan16_raw: u16,
25984 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25985 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25986 pub chan17_raw: u16,
25987 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25988 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25989 pub chan18_raw: u16,
25990}
25991impl RC_CHANNELS_OVERRIDE_DATA {
25992 pub const ENCODED_LEN: usize = 38usize;
25993 pub const DEFAULT: Self = Self {
25994 chan1_raw: 0_u16,
25995 chan2_raw: 0_u16,
25996 chan3_raw: 0_u16,
25997 chan4_raw: 0_u16,
25998 chan5_raw: 0_u16,
25999 chan6_raw: 0_u16,
26000 chan7_raw: 0_u16,
26001 chan8_raw: 0_u16,
26002 target_system: 0_u8,
26003 target_component: 0_u8,
26004 chan9_raw: 0_u16,
26005 chan10_raw: 0_u16,
26006 chan11_raw: 0_u16,
26007 chan12_raw: 0_u16,
26008 chan13_raw: 0_u16,
26009 chan14_raw: 0_u16,
26010 chan15_raw: 0_u16,
26011 chan16_raw: 0_u16,
26012 chan17_raw: 0_u16,
26013 chan18_raw: 0_u16,
26014 };
26015 #[cfg(feature = "arbitrary")]
26016 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26017 use arbitrary::{Arbitrary, Unstructured};
26018 let mut buf = [0u8; 1024];
26019 rng.fill_bytes(&mut buf);
26020 let mut unstructured = Unstructured::new(&buf);
26021 Self::arbitrary(&mut unstructured).unwrap_or_default()
26022 }
26023}
26024impl Default for RC_CHANNELS_OVERRIDE_DATA {
26025 fn default() -> Self {
26026 Self::DEFAULT.clone()
26027 }
26028}
26029impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
26030 type Message = MavMessage;
26031 const ID: u32 = 70u32;
26032 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
26033 const EXTRA_CRC: u8 = 124u8;
26034 const ENCODED_LEN: usize = 38usize;
26035 fn deser(
26036 _version: MavlinkVersion,
26037 __input: &[u8],
26038 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26039 let avail_len = __input.len();
26040 let mut payload_buf = [0; Self::ENCODED_LEN];
26041 let mut buf = if avail_len < Self::ENCODED_LEN {
26042 payload_buf[0..avail_len].copy_from_slice(__input);
26043 Bytes::new(&payload_buf)
26044 } else {
26045 Bytes::new(__input)
26046 };
26047 let mut __struct = Self::default();
26048 __struct.chan1_raw = buf.get_u16_le();
26049 __struct.chan2_raw = buf.get_u16_le();
26050 __struct.chan3_raw = buf.get_u16_le();
26051 __struct.chan4_raw = buf.get_u16_le();
26052 __struct.chan5_raw = buf.get_u16_le();
26053 __struct.chan6_raw = buf.get_u16_le();
26054 __struct.chan7_raw = buf.get_u16_le();
26055 __struct.chan8_raw = buf.get_u16_le();
26056 __struct.target_system = buf.get_u8();
26057 __struct.target_component = buf.get_u8();
26058 __struct.chan9_raw = buf.get_u16_le();
26059 __struct.chan10_raw = buf.get_u16_le();
26060 __struct.chan11_raw = buf.get_u16_le();
26061 __struct.chan12_raw = buf.get_u16_le();
26062 __struct.chan13_raw = buf.get_u16_le();
26063 __struct.chan14_raw = buf.get_u16_le();
26064 __struct.chan15_raw = buf.get_u16_le();
26065 __struct.chan16_raw = buf.get_u16_le();
26066 __struct.chan17_raw = buf.get_u16_le();
26067 __struct.chan18_raw = buf.get_u16_le();
26068 Ok(__struct)
26069 }
26070 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26071 let mut __tmp = BytesMut::new(bytes);
26072 #[allow(clippy::absurd_extreme_comparisons)]
26073 #[allow(unused_comparisons)]
26074 if __tmp.remaining() < Self::ENCODED_LEN {
26075 panic!(
26076 "buffer is too small (need {} bytes, but got {})",
26077 Self::ENCODED_LEN,
26078 __tmp.remaining(),
26079 )
26080 }
26081 __tmp.put_u16_le(self.chan1_raw);
26082 __tmp.put_u16_le(self.chan2_raw);
26083 __tmp.put_u16_le(self.chan3_raw);
26084 __tmp.put_u16_le(self.chan4_raw);
26085 __tmp.put_u16_le(self.chan5_raw);
26086 __tmp.put_u16_le(self.chan6_raw);
26087 __tmp.put_u16_le(self.chan7_raw);
26088 __tmp.put_u16_le(self.chan8_raw);
26089 __tmp.put_u8(self.target_system);
26090 __tmp.put_u8(self.target_component);
26091 if matches!(version, MavlinkVersion::V2) {
26092 __tmp.put_u16_le(self.chan9_raw);
26093 __tmp.put_u16_le(self.chan10_raw);
26094 __tmp.put_u16_le(self.chan11_raw);
26095 __tmp.put_u16_le(self.chan12_raw);
26096 __tmp.put_u16_le(self.chan13_raw);
26097 __tmp.put_u16_le(self.chan14_raw);
26098 __tmp.put_u16_le(self.chan15_raw);
26099 __tmp.put_u16_le(self.chan16_raw);
26100 __tmp.put_u16_le(self.chan17_raw);
26101 __tmp.put_u16_le(self.chan18_raw);
26102 let len = __tmp.len();
26103 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26104 } else {
26105 __tmp.len()
26106 }
26107 }
26108}
26109#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26110#[doc = ""]
26111#[doc = "ID: 35"]
26112#[derive(Debug, Clone, PartialEq)]
26113#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26114#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26115#[cfg_attr(feature = "ts", derive(TS))]
26116#[cfg_attr(feature = "ts", ts(export))]
26117pub struct RC_CHANNELS_RAW_DATA {
26118 #[doc = "Timestamp (time since system boot)."]
26119 pub time_boot_ms: u32,
26120 #[doc = "RC channel 1 value."]
26121 pub chan1_raw: u16,
26122 #[doc = "RC channel 2 value."]
26123 pub chan2_raw: u16,
26124 #[doc = "RC channel 3 value."]
26125 pub chan3_raw: u16,
26126 #[doc = "RC channel 4 value."]
26127 pub chan4_raw: u16,
26128 #[doc = "RC channel 5 value."]
26129 pub chan5_raw: u16,
26130 #[doc = "RC channel 6 value."]
26131 pub chan6_raw: u16,
26132 #[doc = "RC channel 7 value."]
26133 pub chan7_raw: u16,
26134 #[doc = "RC channel 8 value."]
26135 pub chan8_raw: u16,
26136 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26137 pub port: u8,
26138 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26139 pub rssi: u8,
26140}
26141impl RC_CHANNELS_RAW_DATA {
26142 pub const ENCODED_LEN: usize = 22usize;
26143 pub const DEFAULT: Self = Self {
26144 time_boot_ms: 0_u32,
26145 chan1_raw: 0_u16,
26146 chan2_raw: 0_u16,
26147 chan3_raw: 0_u16,
26148 chan4_raw: 0_u16,
26149 chan5_raw: 0_u16,
26150 chan6_raw: 0_u16,
26151 chan7_raw: 0_u16,
26152 chan8_raw: 0_u16,
26153 port: 0_u8,
26154 rssi: 0_u8,
26155 };
26156 #[cfg(feature = "arbitrary")]
26157 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26158 use arbitrary::{Arbitrary, Unstructured};
26159 let mut buf = [0u8; 1024];
26160 rng.fill_bytes(&mut buf);
26161 let mut unstructured = Unstructured::new(&buf);
26162 Self::arbitrary(&mut unstructured).unwrap_or_default()
26163 }
26164}
26165impl Default for RC_CHANNELS_RAW_DATA {
26166 fn default() -> Self {
26167 Self::DEFAULT.clone()
26168 }
26169}
26170impl MessageData for RC_CHANNELS_RAW_DATA {
26171 type Message = MavMessage;
26172 const ID: u32 = 35u32;
26173 const NAME: &'static str = "RC_CHANNELS_RAW";
26174 const EXTRA_CRC: u8 = 244u8;
26175 const ENCODED_LEN: usize = 22usize;
26176 fn deser(
26177 _version: MavlinkVersion,
26178 __input: &[u8],
26179 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26180 let avail_len = __input.len();
26181 let mut payload_buf = [0; Self::ENCODED_LEN];
26182 let mut buf = if avail_len < Self::ENCODED_LEN {
26183 payload_buf[0..avail_len].copy_from_slice(__input);
26184 Bytes::new(&payload_buf)
26185 } else {
26186 Bytes::new(__input)
26187 };
26188 let mut __struct = Self::default();
26189 __struct.time_boot_ms = buf.get_u32_le();
26190 __struct.chan1_raw = buf.get_u16_le();
26191 __struct.chan2_raw = buf.get_u16_le();
26192 __struct.chan3_raw = buf.get_u16_le();
26193 __struct.chan4_raw = buf.get_u16_le();
26194 __struct.chan5_raw = buf.get_u16_le();
26195 __struct.chan6_raw = buf.get_u16_le();
26196 __struct.chan7_raw = buf.get_u16_le();
26197 __struct.chan8_raw = buf.get_u16_le();
26198 __struct.port = buf.get_u8();
26199 __struct.rssi = buf.get_u8();
26200 Ok(__struct)
26201 }
26202 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26203 let mut __tmp = BytesMut::new(bytes);
26204 #[allow(clippy::absurd_extreme_comparisons)]
26205 #[allow(unused_comparisons)]
26206 if __tmp.remaining() < Self::ENCODED_LEN {
26207 panic!(
26208 "buffer is too small (need {} bytes, but got {})",
26209 Self::ENCODED_LEN,
26210 __tmp.remaining(),
26211 )
26212 }
26213 __tmp.put_u32_le(self.time_boot_ms);
26214 __tmp.put_u16_le(self.chan1_raw);
26215 __tmp.put_u16_le(self.chan2_raw);
26216 __tmp.put_u16_le(self.chan3_raw);
26217 __tmp.put_u16_le(self.chan4_raw);
26218 __tmp.put_u16_le(self.chan5_raw);
26219 __tmp.put_u16_le(self.chan6_raw);
26220 __tmp.put_u16_le(self.chan7_raw);
26221 __tmp.put_u16_le(self.chan8_raw);
26222 __tmp.put_u8(self.port);
26223 __tmp.put_u8(self.rssi);
26224 if matches!(version, MavlinkVersion::V2) {
26225 let len = __tmp.len();
26226 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26227 } else {
26228 __tmp.len()
26229 }
26230 }
26231}
26232#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
26233#[doc = ""]
26234#[doc = "ID: 34"]
26235#[derive(Debug, Clone, PartialEq)]
26236#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26237#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26238#[cfg_attr(feature = "ts", derive(TS))]
26239#[cfg_attr(feature = "ts", ts(export))]
26240pub struct RC_CHANNELS_SCALED_DATA {
26241 #[doc = "Timestamp (time since system boot)."]
26242 pub time_boot_ms: u32,
26243 #[doc = "RC channel 1 value scaled."]
26244 pub chan1_scaled: i16,
26245 #[doc = "RC channel 2 value scaled."]
26246 pub chan2_scaled: i16,
26247 #[doc = "RC channel 3 value scaled."]
26248 pub chan3_scaled: i16,
26249 #[doc = "RC channel 4 value scaled."]
26250 pub chan4_scaled: i16,
26251 #[doc = "RC channel 5 value scaled."]
26252 pub chan5_scaled: i16,
26253 #[doc = "RC channel 6 value scaled."]
26254 pub chan6_scaled: i16,
26255 #[doc = "RC channel 7 value scaled."]
26256 pub chan7_scaled: i16,
26257 #[doc = "RC channel 8 value scaled."]
26258 pub chan8_scaled: i16,
26259 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26260 pub port: u8,
26261 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26262 pub rssi: u8,
26263}
26264impl RC_CHANNELS_SCALED_DATA {
26265 pub const ENCODED_LEN: usize = 22usize;
26266 pub const DEFAULT: Self = Self {
26267 time_boot_ms: 0_u32,
26268 chan1_scaled: 0_i16,
26269 chan2_scaled: 0_i16,
26270 chan3_scaled: 0_i16,
26271 chan4_scaled: 0_i16,
26272 chan5_scaled: 0_i16,
26273 chan6_scaled: 0_i16,
26274 chan7_scaled: 0_i16,
26275 chan8_scaled: 0_i16,
26276 port: 0_u8,
26277 rssi: 0_u8,
26278 };
26279 #[cfg(feature = "arbitrary")]
26280 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26281 use arbitrary::{Arbitrary, Unstructured};
26282 let mut buf = [0u8; 1024];
26283 rng.fill_bytes(&mut buf);
26284 let mut unstructured = Unstructured::new(&buf);
26285 Self::arbitrary(&mut unstructured).unwrap_or_default()
26286 }
26287}
26288impl Default for RC_CHANNELS_SCALED_DATA {
26289 fn default() -> Self {
26290 Self::DEFAULT.clone()
26291 }
26292}
26293impl MessageData for RC_CHANNELS_SCALED_DATA {
26294 type Message = MavMessage;
26295 const ID: u32 = 34u32;
26296 const NAME: &'static str = "RC_CHANNELS_SCALED";
26297 const EXTRA_CRC: u8 = 237u8;
26298 const ENCODED_LEN: usize = 22usize;
26299 fn deser(
26300 _version: MavlinkVersion,
26301 __input: &[u8],
26302 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26303 let avail_len = __input.len();
26304 let mut payload_buf = [0; Self::ENCODED_LEN];
26305 let mut buf = if avail_len < Self::ENCODED_LEN {
26306 payload_buf[0..avail_len].copy_from_slice(__input);
26307 Bytes::new(&payload_buf)
26308 } else {
26309 Bytes::new(__input)
26310 };
26311 let mut __struct = Self::default();
26312 __struct.time_boot_ms = buf.get_u32_le();
26313 __struct.chan1_scaled = buf.get_i16_le();
26314 __struct.chan2_scaled = buf.get_i16_le();
26315 __struct.chan3_scaled = buf.get_i16_le();
26316 __struct.chan4_scaled = buf.get_i16_le();
26317 __struct.chan5_scaled = buf.get_i16_le();
26318 __struct.chan6_scaled = buf.get_i16_le();
26319 __struct.chan7_scaled = buf.get_i16_le();
26320 __struct.chan8_scaled = buf.get_i16_le();
26321 __struct.port = buf.get_u8();
26322 __struct.rssi = buf.get_u8();
26323 Ok(__struct)
26324 }
26325 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26326 let mut __tmp = BytesMut::new(bytes);
26327 #[allow(clippy::absurd_extreme_comparisons)]
26328 #[allow(unused_comparisons)]
26329 if __tmp.remaining() < Self::ENCODED_LEN {
26330 panic!(
26331 "buffer is too small (need {} bytes, but got {})",
26332 Self::ENCODED_LEN,
26333 __tmp.remaining(),
26334 )
26335 }
26336 __tmp.put_u32_le(self.time_boot_ms);
26337 __tmp.put_i16_le(self.chan1_scaled);
26338 __tmp.put_i16_le(self.chan2_scaled);
26339 __tmp.put_i16_le(self.chan3_scaled);
26340 __tmp.put_i16_le(self.chan4_scaled);
26341 __tmp.put_i16_le(self.chan5_scaled);
26342 __tmp.put_i16_le(self.chan6_scaled);
26343 __tmp.put_i16_le(self.chan7_scaled);
26344 __tmp.put_i16_le(self.chan8_scaled);
26345 __tmp.put_u8(self.port);
26346 __tmp.put_u8(self.rssi);
26347 if matches!(version, MavlinkVersion::V2) {
26348 let len = __tmp.len();
26349 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26350 } else {
26351 __tmp.len()
26352 }
26353 }
26354}
26355#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
26356#[doc = "Request a data stream."]
26357#[doc = ""]
26358#[doc = "ID: 66"]
26359#[derive(Debug, Clone, PartialEq)]
26360#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26361#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26362#[cfg_attr(feature = "ts", derive(TS))]
26363#[cfg_attr(feature = "ts", ts(export))]
26364pub struct REQUEST_DATA_STREAM_DATA {
26365 #[doc = "The requested message rate"]
26366 pub req_message_rate: u16,
26367 #[doc = "The target requested to send the message stream."]
26368 pub target_system: u8,
26369 #[doc = "The target requested to send the message stream."]
26370 pub target_component: u8,
26371 #[doc = "The ID of the requested data stream"]
26372 pub req_stream_id: u8,
26373 #[doc = "1 to start sending, 0 to stop sending."]
26374 pub start_stop: u8,
26375}
26376impl REQUEST_DATA_STREAM_DATA {
26377 pub const ENCODED_LEN: usize = 6usize;
26378 pub const DEFAULT: Self = Self {
26379 req_message_rate: 0_u16,
26380 target_system: 0_u8,
26381 target_component: 0_u8,
26382 req_stream_id: 0_u8,
26383 start_stop: 0_u8,
26384 };
26385 #[cfg(feature = "arbitrary")]
26386 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26387 use arbitrary::{Arbitrary, Unstructured};
26388 let mut buf = [0u8; 1024];
26389 rng.fill_bytes(&mut buf);
26390 let mut unstructured = Unstructured::new(&buf);
26391 Self::arbitrary(&mut unstructured).unwrap_or_default()
26392 }
26393}
26394impl Default for REQUEST_DATA_STREAM_DATA {
26395 fn default() -> Self {
26396 Self::DEFAULT.clone()
26397 }
26398}
26399impl MessageData for REQUEST_DATA_STREAM_DATA {
26400 type Message = MavMessage;
26401 const ID: u32 = 66u32;
26402 const NAME: &'static str = "REQUEST_DATA_STREAM";
26403 const EXTRA_CRC: u8 = 148u8;
26404 const ENCODED_LEN: usize = 6usize;
26405 fn deser(
26406 _version: MavlinkVersion,
26407 __input: &[u8],
26408 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26409 let avail_len = __input.len();
26410 let mut payload_buf = [0; Self::ENCODED_LEN];
26411 let mut buf = if avail_len < Self::ENCODED_LEN {
26412 payload_buf[0..avail_len].copy_from_slice(__input);
26413 Bytes::new(&payload_buf)
26414 } else {
26415 Bytes::new(__input)
26416 };
26417 let mut __struct = Self::default();
26418 __struct.req_message_rate = buf.get_u16_le();
26419 __struct.target_system = buf.get_u8();
26420 __struct.target_component = buf.get_u8();
26421 __struct.req_stream_id = buf.get_u8();
26422 __struct.start_stop = buf.get_u8();
26423 Ok(__struct)
26424 }
26425 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26426 let mut __tmp = BytesMut::new(bytes);
26427 #[allow(clippy::absurd_extreme_comparisons)]
26428 #[allow(unused_comparisons)]
26429 if __tmp.remaining() < Self::ENCODED_LEN {
26430 panic!(
26431 "buffer is too small (need {} bytes, but got {})",
26432 Self::ENCODED_LEN,
26433 __tmp.remaining(),
26434 )
26435 }
26436 __tmp.put_u16_le(self.req_message_rate);
26437 __tmp.put_u8(self.target_system);
26438 __tmp.put_u8(self.target_component);
26439 __tmp.put_u8(self.req_stream_id);
26440 __tmp.put_u8(self.start_stop);
26441 if matches!(version, MavlinkVersion::V2) {
26442 let len = __tmp.len();
26443 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26444 } else {
26445 __tmp.len()
26446 }
26447 }
26448}
26449#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26450#[doc = ""]
26451#[doc = "ID: 412"]
26452#[derive(Debug, Clone, PartialEq)]
26453#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26454#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26455#[cfg_attr(feature = "ts", derive(TS))]
26456#[cfg_attr(feature = "ts", ts(export))]
26457pub struct REQUEST_EVENT_DATA {
26458 #[doc = "First sequence number of the requested event."]
26459 pub first_sequence: u16,
26460 #[doc = "Last sequence number of the requested event."]
26461 pub last_sequence: u16,
26462 #[doc = "System ID"]
26463 pub target_system: u8,
26464 #[doc = "Component ID"]
26465 pub target_component: u8,
26466}
26467impl REQUEST_EVENT_DATA {
26468 pub const ENCODED_LEN: usize = 6usize;
26469 pub const DEFAULT: Self = Self {
26470 first_sequence: 0_u16,
26471 last_sequence: 0_u16,
26472 target_system: 0_u8,
26473 target_component: 0_u8,
26474 };
26475 #[cfg(feature = "arbitrary")]
26476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26477 use arbitrary::{Arbitrary, Unstructured};
26478 let mut buf = [0u8; 1024];
26479 rng.fill_bytes(&mut buf);
26480 let mut unstructured = Unstructured::new(&buf);
26481 Self::arbitrary(&mut unstructured).unwrap_or_default()
26482 }
26483}
26484impl Default for REQUEST_EVENT_DATA {
26485 fn default() -> Self {
26486 Self::DEFAULT.clone()
26487 }
26488}
26489impl MessageData for REQUEST_EVENT_DATA {
26490 type Message = MavMessage;
26491 const ID: u32 = 412u32;
26492 const NAME: &'static str = "REQUEST_EVENT";
26493 const EXTRA_CRC: u8 = 33u8;
26494 const ENCODED_LEN: usize = 6usize;
26495 fn deser(
26496 _version: MavlinkVersion,
26497 __input: &[u8],
26498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26499 let avail_len = __input.len();
26500 let mut payload_buf = [0; Self::ENCODED_LEN];
26501 let mut buf = if avail_len < Self::ENCODED_LEN {
26502 payload_buf[0..avail_len].copy_from_slice(__input);
26503 Bytes::new(&payload_buf)
26504 } else {
26505 Bytes::new(__input)
26506 };
26507 let mut __struct = Self::default();
26508 __struct.first_sequence = buf.get_u16_le();
26509 __struct.last_sequence = buf.get_u16_le();
26510 __struct.target_system = buf.get_u8();
26511 __struct.target_component = buf.get_u8();
26512 Ok(__struct)
26513 }
26514 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26515 let mut __tmp = BytesMut::new(bytes);
26516 #[allow(clippy::absurd_extreme_comparisons)]
26517 #[allow(unused_comparisons)]
26518 if __tmp.remaining() < Self::ENCODED_LEN {
26519 panic!(
26520 "buffer is too small (need {} bytes, but got {})",
26521 Self::ENCODED_LEN,
26522 __tmp.remaining(),
26523 )
26524 }
26525 __tmp.put_u16_le(self.first_sequence);
26526 __tmp.put_u16_le(self.last_sequence);
26527 __tmp.put_u8(self.target_system);
26528 __tmp.put_u8(self.target_component);
26529 if matches!(version, MavlinkVersion::V2) {
26530 let len = __tmp.len();
26531 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26532 } else {
26533 __tmp.len()
26534 }
26535 }
26536}
26537#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26538#[doc = ""]
26539#[doc = "ID: 142"]
26540#[derive(Debug, Clone, PartialEq)]
26541#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26542#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26543#[cfg_attr(feature = "ts", derive(TS))]
26544#[cfg_attr(feature = "ts", ts(export))]
26545pub struct RESOURCE_REQUEST_DATA {
26546 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26547 pub request_id: u8,
26548 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26549 pub uri_type: u8,
26550 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26551 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26552 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26553 pub uri: [u8; 120],
26554 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26555 pub transfer_type: u8,
26556 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26557 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26558 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26559 pub storage: [u8; 120],
26560}
26561impl RESOURCE_REQUEST_DATA {
26562 pub const ENCODED_LEN: usize = 243usize;
26563 pub const DEFAULT: Self = Self {
26564 request_id: 0_u8,
26565 uri_type: 0_u8,
26566 uri: [0_u8; 120usize],
26567 transfer_type: 0_u8,
26568 storage: [0_u8; 120usize],
26569 };
26570 #[cfg(feature = "arbitrary")]
26571 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26572 use arbitrary::{Arbitrary, Unstructured};
26573 let mut buf = [0u8; 1024];
26574 rng.fill_bytes(&mut buf);
26575 let mut unstructured = Unstructured::new(&buf);
26576 Self::arbitrary(&mut unstructured).unwrap_or_default()
26577 }
26578}
26579impl Default for RESOURCE_REQUEST_DATA {
26580 fn default() -> Self {
26581 Self::DEFAULT.clone()
26582 }
26583}
26584impl MessageData for RESOURCE_REQUEST_DATA {
26585 type Message = MavMessage;
26586 const ID: u32 = 142u32;
26587 const NAME: &'static str = "RESOURCE_REQUEST";
26588 const EXTRA_CRC: u8 = 72u8;
26589 const ENCODED_LEN: usize = 243usize;
26590 fn deser(
26591 _version: MavlinkVersion,
26592 __input: &[u8],
26593 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26594 let avail_len = __input.len();
26595 let mut payload_buf = [0; Self::ENCODED_LEN];
26596 let mut buf = if avail_len < Self::ENCODED_LEN {
26597 payload_buf[0..avail_len].copy_from_slice(__input);
26598 Bytes::new(&payload_buf)
26599 } else {
26600 Bytes::new(__input)
26601 };
26602 let mut __struct = Self::default();
26603 __struct.request_id = buf.get_u8();
26604 __struct.uri_type = buf.get_u8();
26605 for v in &mut __struct.uri {
26606 let val = buf.get_u8();
26607 *v = val;
26608 }
26609 __struct.transfer_type = buf.get_u8();
26610 for v in &mut __struct.storage {
26611 let val = buf.get_u8();
26612 *v = val;
26613 }
26614 Ok(__struct)
26615 }
26616 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26617 let mut __tmp = BytesMut::new(bytes);
26618 #[allow(clippy::absurd_extreme_comparisons)]
26619 #[allow(unused_comparisons)]
26620 if __tmp.remaining() < Self::ENCODED_LEN {
26621 panic!(
26622 "buffer is too small (need {} bytes, but got {})",
26623 Self::ENCODED_LEN,
26624 __tmp.remaining(),
26625 )
26626 }
26627 __tmp.put_u8(self.request_id);
26628 __tmp.put_u8(self.uri_type);
26629 for val in &self.uri {
26630 __tmp.put_u8(*val);
26631 }
26632 __tmp.put_u8(self.transfer_type);
26633 for val in &self.storage {
26634 __tmp.put_u8(*val);
26635 }
26636 if matches!(version, MavlinkVersion::V2) {
26637 let len = __tmp.len();
26638 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26639 } else {
26640 __tmp.len()
26641 }
26642 }
26643}
26644#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26645#[doc = ""]
26646#[doc = "ID: 413"]
26647#[derive(Debug, Clone, PartialEq)]
26648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26649#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26650#[cfg_attr(feature = "ts", derive(TS))]
26651#[cfg_attr(feature = "ts", ts(export))]
26652pub struct RESPONSE_EVENT_ERROR_DATA {
26653 #[doc = "Sequence number."]
26654 pub sequence: u16,
26655 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26656 pub sequence_oldest_available: u16,
26657 #[doc = "System ID"]
26658 pub target_system: u8,
26659 #[doc = "Component ID"]
26660 pub target_component: u8,
26661 #[doc = "Error reason."]
26662 pub reason: MavEventErrorReason,
26663}
26664impl RESPONSE_EVENT_ERROR_DATA {
26665 pub const ENCODED_LEN: usize = 7usize;
26666 pub const DEFAULT: Self = Self {
26667 sequence: 0_u16,
26668 sequence_oldest_available: 0_u16,
26669 target_system: 0_u8,
26670 target_component: 0_u8,
26671 reason: MavEventErrorReason::DEFAULT,
26672 };
26673 #[cfg(feature = "arbitrary")]
26674 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26675 use arbitrary::{Arbitrary, Unstructured};
26676 let mut buf = [0u8; 1024];
26677 rng.fill_bytes(&mut buf);
26678 let mut unstructured = Unstructured::new(&buf);
26679 Self::arbitrary(&mut unstructured).unwrap_or_default()
26680 }
26681}
26682impl Default for RESPONSE_EVENT_ERROR_DATA {
26683 fn default() -> Self {
26684 Self::DEFAULT.clone()
26685 }
26686}
26687impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26688 type Message = MavMessage;
26689 const ID: u32 = 413u32;
26690 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26691 const EXTRA_CRC: u8 = 77u8;
26692 const ENCODED_LEN: usize = 7usize;
26693 fn deser(
26694 _version: MavlinkVersion,
26695 __input: &[u8],
26696 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26697 let avail_len = __input.len();
26698 let mut payload_buf = [0; Self::ENCODED_LEN];
26699 let mut buf = if avail_len < Self::ENCODED_LEN {
26700 payload_buf[0..avail_len].copy_from_slice(__input);
26701 Bytes::new(&payload_buf)
26702 } else {
26703 Bytes::new(__input)
26704 };
26705 let mut __struct = Self::default();
26706 __struct.sequence = buf.get_u16_le();
26707 __struct.sequence_oldest_available = buf.get_u16_le();
26708 __struct.target_system = buf.get_u8();
26709 __struct.target_component = buf.get_u8();
26710 let tmp = buf.get_u8();
26711 __struct.reason =
26712 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26713 enum_type: "MavEventErrorReason",
26714 value: tmp as u32,
26715 })?;
26716 Ok(__struct)
26717 }
26718 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26719 let mut __tmp = BytesMut::new(bytes);
26720 #[allow(clippy::absurd_extreme_comparisons)]
26721 #[allow(unused_comparisons)]
26722 if __tmp.remaining() < Self::ENCODED_LEN {
26723 panic!(
26724 "buffer is too small (need {} bytes, but got {})",
26725 Self::ENCODED_LEN,
26726 __tmp.remaining(),
26727 )
26728 }
26729 __tmp.put_u16_le(self.sequence);
26730 __tmp.put_u16_le(self.sequence_oldest_available);
26731 __tmp.put_u8(self.target_system);
26732 __tmp.put_u8(self.target_component);
26733 __tmp.put_u8(self.reason as u8);
26734 if matches!(version, MavlinkVersion::V2) {
26735 let len = __tmp.len();
26736 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26737 } else {
26738 __tmp.len()
26739 }
26740 }
26741}
26742#[doc = "Read out the safety zone the MAV currently assumes."]
26743#[doc = ""]
26744#[doc = "ID: 55"]
26745#[derive(Debug, Clone, PartialEq)]
26746#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26748#[cfg_attr(feature = "ts", derive(TS))]
26749#[cfg_attr(feature = "ts", ts(export))]
26750pub struct SAFETY_ALLOWED_AREA_DATA {
26751 #[doc = "x position 1 / Latitude 1"]
26752 pub p1x: f32,
26753 #[doc = "y position 1 / Longitude 1"]
26754 pub p1y: f32,
26755 #[doc = "z position 1 / Altitude 1"]
26756 pub p1z: f32,
26757 #[doc = "x position 2 / Latitude 2"]
26758 pub p2x: f32,
26759 #[doc = "y position 2 / Longitude 2"]
26760 pub p2y: f32,
26761 #[doc = "z position 2 / Altitude 2"]
26762 pub p2z: f32,
26763 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26764 pub frame: MavFrame,
26765}
26766impl SAFETY_ALLOWED_AREA_DATA {
26767 pub const ENCODED_LEN: usize = 25usize;
26768 pub const DEFAULT: Self = Self {
26769 p1x: 0.0_f32,
26770 p1y: 0.0_f32,
26771 p1z: 0.0_f32,
26772 p2x: 0.0_f32,
26773 p2y: 0.0_f32,
26774 p2z: 0.0_f32,
26775 frame: MavFrame::DEFAULT,
26776 };
26777 #[cfg(feature = "arbitrary")]
26778 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26779 use arbitrary::{Arbitrary, Unstructured};
26780 let mut buf = [0u8; 1024];
26781 rng.fill_bytes(&mut buf);
26782 let mut unstructured = Unstructured::new(&buf);
26783 Self::arbitrary(&mut unstructured).unwrap_or_default()
26784 }
26785}
26786impl Default for SAFETY_ALLOWED_AREA_DATA {
26787 fn default() -> Self {
26788 Self::DEFAULT.clone()
26789 }
26790}
26791impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26792 type Message = MavMessage;
26793 const ID: u32 = 55u32;
26794 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26795 const EXTRA_CRC: u8 = 3u8;
26796 const ENCODED_LEN: usize = 25usize;
26797 fn deser(
26798 _version: MavlinkVersion,
26799 __input: &[u8],
26800 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26801 let avail_len = __input.len();
26802 let mut payload_buf = [0; Self::ENCODED_LEN];
26803 let mut buf = if avail_len < Self::ENCODED_LEN {
26804 payload_buf[0..avail_len].copy_from_slice(__input);
26805 Bytes::new(&payload_buf)
26806 } else {
26807 Bytes::new(__input)
26808 };
26809 let mut __struct = Self::default();
26810 __struct.p1x = buf.get_f32_le();
26811 __struct.p1y = buf.get_f32_le();
26812 __struct.p1z = buf.get_f32_le();
26813 __struct.p2x = buf.get_f32_le();
26814 __struct.p2y = buf.get_f32_le();
26815 __struct.p2z = buf.get_f32_le();
26816 let tmp = buf.get_u8();
26817 __struct.frame =
26818 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26819 enum_type: "MavFrame",
26820 value: tmp as u32,
26821 })?;
26822 Ok(__struct)
26823 }
26824 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26825 let mut __tmp = BytesMut::new(bytes);
26826 #[allow(clippy::absurd_extreme_comparisons)]
26827 #[allow(unused_comparisons)]
26828 if __tmp.remaining() < Self::ENCODED_LEN {
26829 panic!(
26830 "buffer is too small (need {} bytes, but got {})",
26831 Self::ENCODED_LEN,
26832 __tmp.remaining(),
26833 )
26834 }
26835 __tmp.put_f32_le(self.p1x);
26836 __tmp.put_f32_le(self.p1y);
26837 __tmp.put_f32_le(self.p1z);
26838 __tmp.put_f32_le(self.p2x);
26839 __tmp.put_f32_le(self.p2y);
26840 __tmp.put_f32_le(self.p2z);
26841 __tmp.put_u8(self.frame as u8);
26842 if matches!(version, MavlinkVersion::V2) {
26843 let len = __tmp.len();
26844 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26845 } else {
26846 __tmp.len()
26847 }
26848 }
26849}
26850#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26851#[doc = ""]
26852#[doc = "ID: 54"]
26853#[derive(Debug, Clone, PartialEq)]
26854#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26855#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26856#[cfg_attr(feature = "ts", derive(TS))]
26857#[cfg_attr(feature = "ts", ts(export))]
26858pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26859 #[doc = "x position 1 / Latitude 1"]
26860 pub p1x: f32,
26861 #[doc = "y position 1 / Longitude 1"]
26862 pub p1y: f32,
26863 #[doc = "z position 1 / Altitude 1"]
26864 pub p1z: f32,
26865 #[doc = "x position 2 / Latitude 2"]
26866 pub p2x: f32,
26867 #[doc = "y position 2 / Longitude 2"]
26868 pub p2y: f32,
26869 #[doc = "z position 2 / Altitude 2"]
26870 pub p2z: f32,
26871 #[doc = "System ID"]
26872 pub target_system: u8,
26873 #[doc = "Component ID"]
26874 pub target_component: u8,
26875 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26876 pub frame: MavFrame,
26877}
26878impl SAFETY_SET_ALLOWED_AREA_DATA {
26879 pub const ENCODED_LEN: usize = 27usize;
26880 pub const DEFAULT: Self = Self {
26881 p1x: 0.0_f32,
26882 p1y: 0.0_f32,
26883 p1z: 0.0_f32,
26884 p2x: 0.0_f32,
26885 p2y: 0.0_f32,
26886 p2z: 0.0_f32,
26887 target_system: 0_u8,
26888 target_component: 0_u8,
26889 frame: MavFrame::DEFAULT,
26890 };
26891 #[cfg(feature = "arbitrary")]
26892 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26893 use arbitrary::{Arbitrary, Unstructured};
26894 let mut buf = [0u8; 1024];
26895 rng.fill_bytes(&mut buf);
26896 let mut unstructured = Unstructured::new(&buf);
26897 Self::arbitrary(&mut unstructured).unwrap_or_default()
26898 }
26899}
26900impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26901 fn default() -> Self {
26902 Self::DEFAULT.clone()
26903 }
26904}
26905impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26906 type Message = MavMessage;
26907 const ID: u32 = 54u32;
26908 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26909 const EXTRA_CRC: u8 = 15u8;
26910 const ENCODED_LEN: usize = 27usize;
26911 fn deser(
26912 _version: MavlinkVersion,
26913 __input: &[u8],
26914 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26915 let avail_len = __input.len();
26916 let mut payload_buf = [0; Self::ENCODED_LEN];
26917 let mut buf = if avail_len < Self::ENCODED_LEN {
26918 payload_buf[0..avail_len].copy_from_slice(__input);
26919 Bytes::new(&payload_buf)
26920 } else {
26921 Bytes::new(__input)
26922 };
26923 let mut __struct = Self::default();
26924 __struct.p1x = buf.get_f32_le();
26925 __struct.p1y = buf.get_f32_le();
26926 __struct.p1z = buf.get_f32_le();
26927 __struct.p2x = buf.get_f32_le();
26928 __struct.p2y = buf.get_f32_le();
26929 __struct.p2z = buf.get_f32_le();
26930 __struct.target_system = buf.get_u8();
26931 __struct.target_component = buf.get_u8();
26932 let tmp = buf.get_u8();
26933 __struct.frame =
26934 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26935 enum_type: "MavFrame",
26936 value: tmp as u32,
26937 })?;
26938 Ok(__struct)
26939 }
26940 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26941 let mut __tmp = BytesMut::new(bytes);
26942 #[allow(clippy::absurd_extreme_comparisons)]
26943 #[allow(unused_comparisons)]
26944 if __tmp.remaining() < Self::ENCODED_LEN {
26945 panic!(
26946 "buffer is too small (need {} bytes, but got {})",
26947 Self::ENCODED_LEN,
26948 __tmp.remaining(),
26949 )
26950 }
26951 __tmp.put_f32_le(self.p1x);
26952 __tmp.put_f32_le(self.p1y);
26953 __tmp.put_f32_le(self.p1z);
26954 __tmp.put_f32_le(self.p2x);
26955 __tmp.put_f32_le(self.p2y);
26956 __tmp.put_f32_le(self.p2z);
26957 __tmp.put_u8(self.target_system);
26958 __tmp.put_u8(self.target_component);
26959 __tmp.put_u8(self.frame as u8);
26960 if matches!(version, MavlinkVersion::V2) {
26961 let len = __tmp.len();
26962 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26963 } else {
26964 __tmp.len()
26965 }
26966 }
26967}
26968#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26969#[doc = ""]
26970#[doc = "ID: 26"]
26971#[derive(Debug, Clone, PartialEq)]
26972#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26973#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26974#[cfg_attr(feature = "ts", derive(TS))]
26975#[cfg_attr(feature = "ts", ts(export))]
26976pub struct SCALED_IMU_DATA {
26977 #[doc = "Timestamp (time since system boot)."]
26978 pub time_boot_ms: u32,
26979 #[doc = "X acceleration"]
26980 pub xacc: i16,
26981 #[doc = "Y acceleration"]
26982 pub yacc: i16,
26983 #[doc = "Z acceleration"]
26984 pub zacc: i16,
26985 #[doc = "Angular speed around X axis"]
26986 pub xgyro: i16,
26987 #[doc = "Angular speed around Y axis"]
26988 pub ygyro: i16,
26989 #[doc = "Angular speed around Z axis"]
26990 pub zgyro: i16,
26991 #[doc = "X Magnetic field"]
26992 pub xmag: i16,
26993 #[doc = "Y Magnetic field"]
26994 pub ymag: i16,
26995 #[doc = "Z Magnetic field"]
26996 pub zmag: i16,
26997 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26998 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26999 pub temperature: i16,
27000}
27001impl SCALED_IMU_DATA {
27002 pub const ENCODED_LEN: usize = 24usize;
27003 pub const DEFAULT: Self = Self {
27004 time_boot_ms: 0_u32,
27005 xacc: 0_i16,
27006 yacc: 0_i16,
27007 zacc: 0_i16,
27008 xgyro: 0_i16,
27009 ygyro: 0_i16,
27010 zgyro: 0_i16,
27011 xmag: 0_i16,
27012 ymag: 0_i16,
27013 zmag: 0_i16,
27014 temperature: 0_i16,
27015 };
27016 #[cfg(feature = "arbitrary")]
27017 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27018 use arbitrary::{Arbitrary, Unstructured};
27019 let mut buf = [0u8; 1024];
27020 rng.fill_bytes(&mut buf);
27021 let mut unstructured = Unstructured::new(&buf);
27022 Self::arbitrary(&mut unstructured).unwrap_or_default()
27023 }
27024}
27025impl Default for SCALED_IMU_DATA {
27026 fn default() -> Self {
27027 Self::DEFAULT.clone()
27028 }
27029}
27030impl MessageData for SCALED_IMU_DATA {
27031 type Message = MavMessage;
27032 const ID: u32 = 26u32;
27033 const NAME: &'static str = "SCALED_IMU";
27034 const EXTRA_CRC: u8 = 170u8;
27035 const ENCODED_LEN: usize = 24usize;
27036 fn deser(
27037 _version: MavlinkVersion,
27038 __input: &[u8],
27039 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27040 let avail_len = __input.len();
27041 let mut payload_buf = [0; Self::ENCODED_LEN];
27042 let mut buf = if avail_len < Self::ENCODED_LEN {
27043 payload_buf[0..avail_len].copy_from_slice(__input);
27044 Bytes::new(&payload_buf)
27045 } else {
27046 Bytes::new(__input)
27047 };
27048 let mut __struct = Self::default();
27049 __struct.time_boot_ms = buf.get_u32_le();
27050 __struct.xacc = buf.get_i16_le();
27051 __struct.yacc = buf.get_i16_le();
27052 __struct.zacc = buf.get_i16_le();
27053 __struct.xgyro = buf.get_i16_le();
27054 __struct.ygyro = buf.get_i16_le();
27055 __struct.zgyro = buf.get_i16_le();
27056 __struct.xmag = buf.get_i16_le();
27057 __struct.ymag = buf.get_i16_le();
27058 __struct.zmag = buf.get_i16_le();
27059 __struct.temperature = buf.get_i16_le();
27060 Ok(__struct)
27061 }
27062 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27063 let mut __tmp = BytesMut::new(bytes);
27064 #[allow(clippy::absurd_extreme_comparisons)]
27065 #[allow(unused_comparisons)]
27066 if __tmp.remaining() < Self::ENCODED_LEN {
27067 panic!(
27068 "buffer is too small (need {} bytes, but got {})",
27069 Self::ENCODED_LEN,
27070 __tmp.remaining(),
27071 )
27072 }
27073 __tmp.put_u32_le(self.time_boot_ms);
27074 __tmp.put_i16_le(self.xacc);
27075 __tmp.put_i16_le(self.yacc);
27076 __tmp.put_i16_le(self.zacc);
27077 __tmp.put_i16_le(self.xgyro);
27078 __tmp.put_i16_le(self.ygyro);
27079 __tmp.put_i16_le(self.zgyro);
27080 __tmp.put_i16_le(self.xmag);
27081 __tmp.put_i16_le(self.ymag);
27082 __tmp.put_i16_le(self.zmag);
27083 if matches!(version, MavlinkVersion::V2) {
27084 __tmp.put_i16_le(self.temperature);
27085 let len = __tmp.len();
27086 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27087 } else {
27088 __tmp.len()
27089 }
27090 }
27091}
27092#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
27093#[doc = ""]
27094#[doc = "ID: 116"]
27095#[derive(Debug, Clone, PartialEq)]
27096#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27097#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27098#[cfg_attr(feature = "ts", derive(TS))]
27099#[cfg_attr(feature = "ts", ts(export))]
27100pub struct SCALED_IMU2_DATA {
27101 #[doc = "Timestamp (time since system boot)."]
27102 pub time_boot_ms: u32,
27103 #[doc = "X acceleration"]
27104 pub xacc: i16,
27105 #[doc = "Y acceleration"]
27106 pub yacc: i16,
27107 #[doc = "Z acceleration"]
27108 pub zacc: i16,
27109 #[doc = "Angular speed around X axis"]
27110 pub xgyro: i16,
27111 #[doc = "Angular speed around Y axis"]
27112 pub ygyro: i16,
27113 #[doc = "Angular speed around Z axis"]
27114 pub zgyro: i16,
27115 #[doc = "X Magnetic field"]
27116 pub xmag: i16,
27117 #[doc = "Y Magnetic field"]
27118 pub ymag: i16,
27119 #[doc = "Z Magnetic field"]
27120 pub zmag: i16,
27121 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27122 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27123 pub temperature: i16,
27124}
27125impl SCALED_IMU2_DATA {
27126 pub const ENCODED_LEN: usize = 24usize;
27127 pub const DEFAULT: Self = Self {
27128 time_boot_ms: 0_u32,
27129 xacc: 0_i16,
27130 yacc: 0_i16,
27131 zacc: 0_i16,
27132 xgyro: 0_i16,
27133 ygyro: 0_i16,
27134 zgyro: 0_i16,
27135 xmag: 0_i16,
27136 ymag: 0_i16,
27137 zmag: 0_i16,
27138 temperature: 0_i16,
27139 };
27140 #[cfg(feature = "arbitrary")]
27141 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27142 use arbitrary::{Arbitrary, Unstructured};
27143 let mut buf = [0u8; 1024];
27144 rng.fill_bytes(&mut buf);
27145 let mut unstructured = Unstructured::new(&buf);
27146 Self::arbitrary(&mut unstructured).unwrap_or_default()
27147 }
27148}
27149impl Default for SCALED_IMU2_DATA {
27150 fn default() -> Self {
27151 Self::DEFAULT.clone()
27152 }
27153}
27154impl MessageData for SCALED_IMU2_DATA {
27155 type Message = MavMessage;
27156 const ID: u32 = 116u32;
27157 const NAME: &'static str = "SCALED_IMU2";
27158 const EXTRA_CRC: u8 = 76u8;
27159 const ENCODED_LEN: usize = 24usize;
27160 fn deser(
27161 _version: MavlinkVersion,
27162 __input: &[u8],
27163 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27164 let avail_len = __input.len();
27165 let mut payload_buf = [0; Self::ENCODED_LEN];
27166 let mut buf = if avail_len < Self::ENCODED_LEN {
27167 payload_buf[0..avail_len].copy_from_slice(__input);
27168 Bytes::new(&payload_buf)
27169 } else {
27170 Bytes::new(__input)
27171 };
27172 let mut __struct = Self::default();
27173 __struct.time_boot_ms = buf.get_u32_le();
27174 __struct.xacc = buf.get_i16_le();
27175 __struct.yacc = buf.get_i16_le();
27176 __struct.zacc = buf.get_i16_le();
27177 __struct.xgyro = buf.get_i16_le();
27178 __struct.ygyro = buf.get_i16_le();
27179 __struct.zgyro = buf.get_i16_le();
27180 __struct.xmag = buf.get_i16_le();
27181 __struct.ymag = buf.get_i16_le();
27182 __struct.zmag = buf.get_i16_le();
27183 __struct.temperature = buf.get_i16_le();
27184 Ok(__struct)
27185 }
27186 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27187 let mut __tmp = BytesMut::new(bytes);
27188 #[allow(clippy::absurd_extreme_comparisons)]
27189 #[allow(unused_comparisons)]
27190 if __tmp.remaining() < Self::ENCODED_LEN {
27191 panic!(
27192 "buffer is too small (need {} bytes, but got {})",
27193 Self::ENCODED_LEN,
27194 __tmp.remaining(),
27195 )
27196 }
27197 __tmp.put_u32_le(self.time_boot_ms);
27198 __tmp.put_i16_le(self.xacc);
27199 __tmp.put_i16_le(self.yacc);
27200 __tmp.put_i16_le(self.zacc);
27201 __tmp.put_i16_le(self.xgyro);
27202 __tmp.put_i16_le(self.ygyro);
27203 __tmp.put_i16_le(self.zgyro);
27204 __tmp.put_i16_le(self.xmag);
27205 __tmp.put_i16_le(self.ymag);
27206 __tmp.put_i16_le(self.zmag);
27207 if matches!(version, MavlinkVersion::V2) {
27208 __tmp.put_i16_le(self.temperature);
27209 let len = __tmp.len();
27210 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27211 } else {
27212 __tmp.len()
27213 }
27214 }
27215}
27216#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
27217#[doc = ""]
27218#[doc = "ID: 129"]
27219#[derive(Debug, Clone, PartialEq)]
27220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27221#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27222#[cfg_attr(feature = "ts", derive(TS))]
27223#[cfg_attr(feature = "ts", ts(export))]
27224pub struct SCALED_IMU3_DATA {
27225 #[doc = "Timestamp (time since system boot)."]
27226 pub time_boot_ms: u32,
27227 #[doc = "X acceleration"]
27228 pub xacc: i16,
27229 #[doc = "Y acceleration"]
27230 pub yacc: i16,
27231 #[doc = "Z acceleration"]
27232 pub zacc: i16,
27233 #[doc = "Angular speed around X axis"]
27234 pub xgyro: i16,
27235 #[doc = "Angular speed around Y axis"]
27236 pub ygyro: i16,
27237 #[doc = "Angular speed around Z axis"]
27238 pub zgyro: i16,
27239 #[doc = "X Magnetic field"]
27240 pub xmag: i16,
27241 #[doc = "Y Magnetic field"]
27242 pub ymag: i16,
27243 #[doc = "Z Magnetic field"]
27244 pub zmag: i16,
27245 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27246 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27247 pub temperature: i16,
27248}
27249impl SCALED_IMU3_DATA {
27250 pub const ENCODED_LEN: usize = 24usize;
27251 pub const DEFAULT: Self = Self {
27252 time_boot_ms: 0_u32,
27253 xacc: 0_i16,
27254 yacc: 0_i16,
27255 zacc: 0_i16,
27256 xgyro: 0_i16,
27257 ygyro: 0_i16,
27258 zgyro: 0_i16,
27259 xmag: 0_i16,
27260 ymag: 0_i16,
27261 zmag: 0_i16,
27262 temperature: 0_i16,
27263 };
27264 #[cfg(feature = "arbitrary")]
27265 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27266 use arbitrary::{Arbitrary, Unstructured};
27267 let mut buf = [0u8; 1024];
27268 rng.fill_bytes(&mut buf);
27269 let mut unstructured = Unstructured::new(&buf);
27270 Self::arbitrary(&mut unstructured).unwrap_or_default()
27271 }
27272}
27273impl Default for SCALED_IMU3_DATA {
27274 fn default() -> Self {
27275 Self::DEFAULT.clone()
27276 }
27277}
27278impl MessageData for SCALED_IMU3_DATA {
27279 type Message = MavMessage;
27280 const ID: u32 = 129u32;
27281 const NAME: &'static str = "SCALED_IMU3";
27282 const EXTRA_CRC: u8 = 46u8;
27283 const ENCODED_LEN: usize = 24usize;
27284 fn deser(
27285 _version: MavlinkVersion,
27286 __input: &[u8],
27287 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27288 let avail_len = __input.len();
27289 let mut payload_buf = [0; Self::ENCODED_LEN];
27290 let mut buf = if avail_len < Self::ENCODED_LEN {
27291 payload_buf[0..avail_len].copy_from_slice(__input);
27292 Bytes::new(&payload_buf)
27293 } else {
27294 Bytes::new(__input)
27295 };
27296 let mut __struct = Self::default();
27297 __struct.time_boot_ms = buf.get_u32_le();
27298 __struct.xacc = buf.get_i16_le();
27299 __struct.yacc = buf.get_i16_le();
27300 __struct.zacc = buf.get_i16_le();
27301 __struct.xgyro = buf.get_i16_le();
27302 __struct.ygyro = buf.get_i16_le();
27303 __struct.zgyro = buf.get_i16_le();
27304 __struct.xmag = buf.get_i16_le();
27305 __struct.ymag = buf.get_i16_le();
27306 __struct.zmag = buf.get_i16_le();
27307 __struct.temperature = buf.get_i16_le();
27308 Ok(__struct)
27309 }
27310 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27311 let mut __tmp = BytesMut::new(bytes);
27312 #[allow(clippy::absurd_extreme_comparisons)]
27313 #[allow(unused_comparisons)]
27314 if __tmp.remaining() < Self::ENCODED_LEN {
27315 panic!(
27316 "buffer is too small (need {} bytes, but got {})",
27317 Self::ENCODED_LEN,
27318 __tmp.remaining(),
27319 )
27320 }
27321 __tmp.put_u32_le(self.time_boot_ms);
27322 __tmp.put_i16_le(self.xacc);
27323 __tmp.put_i16_le(self.yacc);
27324 __tmp.put_i16_le(self.zacc);
27325 __tmp.put_i16_le(self.xgyro);
27326 __tmp.put_i16_le(self.ygyro);
27327 __tmp.put_i16_le(self.zgyro);
27328 __tmp.put_i16_le(self.xmag);
27329 __tmp.put_i16_le(self.ymag);
27330 __tmp.put_i16_le(self.zmag);
27331 if matches!(version, MavlinkVersion::V2) {
27332 __tmp.put_i16_le(self.temperature);
27333 let len = __tmp.len();
27334 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27335 } else {
27336 __tmp.len()
27337 }
27338 }
27339}
27340#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27341#[doc = ""]
27342#[doc = "ID: 29"]
27343#[derive(Debug, Clone, PartialEq)]
27344#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27345#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27346#[cfg_attr(feature = "ts", derive(TS))]
27347#[cfg_attr(feature = "ts", ts(export))]
27348pub struct SCALED_PRESSURE_DATA {
27349 #[doc = "Timestamp (time since system boot)."]
27350 pub time_boot_ms: u32,
27351 #[doc = "Absolute pressure"]
27352 pub press_abs: f32,
27353 #[doc = "Differential pressure 1"]
27354 pub press_diff: f32,
27355 #[doc = "Absolute pressure temperature"]
27356 pub temperature: i16,
27357 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27358 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27359 pub temperature_press_diff: i16,
27360}
27361impl SCALED_PRESSURE_DATA {
27362 pub const ENCODED_LEN: usize = 16usize;
27363 pub const DEFAULT: Self = Self {
27364 time_boot_ms: 0_u32,
27365 press_abs: 0.0_f32,
27366 press_diff: 0.0_f32,
27367 temperature: 0_i16,
27368 temperature_press_diff: 0_i16,
27369 };
27370 #[cfg(feature = "arbitrary")]
27371 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27372 use arbitrary::{Arbitrary, Unstructured};
27373 let mut buf = [0u8; 1024];
27374 rng.fill_bytes(&mut buf);
27375 let mut unstructured = Unstructured::new(&buf);
27376 Self::arbitrary(&mut unstructured).unwrap_or_default()
27377 }
27378}
27379impl Default for SCALED_PRESSURE_DATA {
27380 fn default() -> Self {
27381 Self::DEFAULT.clone()
27382 }
27383}
27384impl MessageData for SCALED_PRESSURE_DATA {
27385 type Message = MavMessage;
27386 const ID: u32 = 29u32;
27387 const NAME: &'static str = "SCALED_PRESSURE";
27388 const EXTRA_CRC: u8 = 115u8;
27389 const ENCODED_LEN: usize = 16usize;
27390 fn deser(
27391 _version: MavlinkVersion,
27392 __input: &[u8],
27393 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27394 let avail_len = __input.len();
27395 let mut payload_buf = [0; Self::ENCODED_LEN];
27396 let mut buf = if avail_len < Self::ENCODED_LEN {
27397 payload_buf[0..avail_len].copy_from_slice(__input);
27398 Bytes::new(&payload_buf)
27399 } else {
27400 Bytes::new(__input)
27401 };
27402 let mut __struct = Self::default();
27403 __struct.time_boot_ms = buf.get_u32_le();
27404 __struct.press_abs = buf.get_f32_le();
27405 __struct.press_diff = buf.get_f32_le();
27406 __struct.temperature = buf.get_i16_le();
27407 __struct.temperature_press_diff = buf.get_i16_le();
27408 Ok(__struct)
27409 }
27410 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27411 let mut __tmp = BytesMut::new(bytes);
27412 #[allow(clippy::absurd_extreme_comparisons)]
27413 #[allow(unused_comparisons)]
27414 if __tmp.remaining() < Self::ENCODED_LEN {
27415 panic!(
27416 "buffer is too small (need {} bytes, but got {})",
27417 Self::ENCODED_LEN,
27418 __tmp.remaining(),
27419 )
27420 }
27421 __tmp.put_u32_le(self.time_boot_ms);
27422 __tmp.put_f32_le(self.press_abs);
27423 __tmp.put_f32_le(self.press_diff);
27424 __tmp.put_i16_le(self.temperature);
27425 if matches!(version, MavlinkVersion::V2) {
27426 __tmp.put_i16_le(self.temperature_press_diff);
27427 let len = __tmp.len();
27428 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27429 } else {
27430 __tmp.len()
27431 }
27432 }
27433}
27434#[doc = "Barometer readings for 2nd barometer."]
27435#[doc = ""]
27436#[doc = "ID: 137"]
27437#[derive(Debug, Clone, PartialEq)]
27438#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27439#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27440#[cfg_attr(feature = "ts", derive(TS))]
27441#[cfg_attr(feature = "ts", ts(export))]
27442pub struct SCALED_PRESSURE2_DATA {
27443 #[doc = "Timestamp (time since system boot)."]
27444 pub time_boot_ms: u32,
27445 #[doc = "Absolute pressure"]
27446 pub press_abs: f32,
27447 #[doc = "Differential pressure"]
27448 pub press_diff: f32,
27449 #[doc = "Absolute pressure temperature"]
27450 pub temperature: i16,
27451 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27452 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27453 pub temperature_press_diff: i16,
27454}
27455impl SCALED_PRESSURE2_DATA {
27456 pub const ENCODED_LEN: usize = 16usize;
27457 pub const DEFAULT: Self = Self {
27458 time_boot_ms: 0_u32,
27459 press_abs: 0.0_f32,
27460 press_diff: 0.0_f32,
27461 temperature: 0_i16,
27462 temperature_press_diff: 0_i16,
27463 };
27464 #[cfg(feature = "arbitrary")]
27465 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27466 use arbitrary::{Arbitrary, Unstructured};
27467 let mut buf = [0u8; 1024];
27468 rng.fill_bytes(&mut buf);
27469 let mut unstructured = Unstructured::new(&buf);
27470 Self::arbitrary(&mut unstructured).unwrap_or_default()
27471 }
27472}
27473impl Default for SCALED_PRESSURE2_DATA {
27474 fn default() -> Self {
27475 Self::DEFAULT.clone()
27476 }
27477}
27478impl MessageData for SCALED_PRESSURE2_DATA {
27479 type Message = MavMessage;
27480 const ID: u32 = 137u32;
27481 const NAME: &'static str = "SCALED_PRESSURE2";
27482 const EXTRA_CRC: u8 = 195u8;
27483 const ENCODED_LEN: usize = 16usize;
27484 fn deser(
27485 _version: MavlinkVersion,
27486 __input: &[u8],
27487 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27488 let avail_len = __input.len();
27489 let mut payload_buf = [0; Self::ENCODED_LEN];
27490 let mut buf = if avail_len < Self::ENCODED_LEN {
27491 payload_buf[0..avail_len].copy_from_slice(__input);
27492 Bytes::new(&payload_buf)
27493 } else {
27494 Bytes::new(__input)
27495 };
27496 let mut __struct = Self::default();
27497 __struct.time_boot_ms = buf.get_u32_le();
27498 __struct.press_abs = buf.get_f32_le();
27499 __struct.press_diff = buf.get_f32_le();
27500 __struct.temperature = buf.get_i16_le();
27501 __struct.temperature_press_diff = buf.get_i16_le();
27502 Ok(__struct)
27503 }
27504 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27505 let mut __tmp = BytesMut::new(bytes);
27506 #[allow(clippy::absurd_extreme_comparisons)]
27507 #[allow(unused_comparisons)]
27508 if __tmp.remaining() < Self::ENCODED_LEN {
27509 panic!(
27510 "buffer is too small (need {} bytes, but got {})",
27511 Self::ENCODED_LEN,
27512 __tmp.remaining(),
27513 )
27514 }
27515 __tmp.put_u32_le(self.time_boot_ms);
27516 __tmp.put_f32_le(self.press_abs);
27517 __tmp.put_f32_le(self.press_diff);
27518 __tmp.put_i16_le(self.temperature);
27519 if matches!(version, MavlinkVersion::V2) {
27520 __tmp.put_i16_le(self.temperature_press_diff);
27521 let len = __tmp.len();
27522 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27523 } else {
27524 __tmp.len()
27525 }
27526 }
27527}
27528#[doc = "Barometer readings for 3rd barometer."]
27529#[doc = ""]
27530#[doc = "ID: 143"]
27531#[derive(Debug, Clone, PartialEq)]
27532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27533#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27534#[cfg_attr(feature = "ts", derive(TS))]
27535#[cfg_attr(feature = "ts", ts(export))]
27536pub struct SCALED_PRESSURE3_DATA {
27537 #[doc = "Timestamp (time since system boot)."]
27538 pub time_boot_ms: u32,
27539 #[doc = "Absolute pressure"]
27540 pub press_abs: f32,
27541 #[doc = "Differential pressure"]
27542 pub press_diff: f32,
27543 #[doc = "Absolute pressure temperature"]
27544 pub temperature: i16,
27545 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27546 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27547 pub temperature_press_diff: i16,
27548}
27549impl SCALED_PRESSURE3_DATA {
27550 pub const ENCODED_LEN: usize = 16usize;
27551 pub const DEFAULT: Self = Self {
27552 time_boot_ms: 0_u32,
27553 press_abs: 0.0_f32,
27554 press_diff: 0.0_f32,
27555 temperature: 0_i16,
27556 temperature_press_diff: 0_i16,
27557 };
27558 #[cfg(feature = "arbitrary")]
27559 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27560 use arbitrary::{Arbitrary, Unstructured};
27561 let mut buf = [0u8; 1024];
27562 rng.fill_bytes(&mut buf);
27563 let mut unstructured = Unstructured::new(&buf);
27564 Self::arbitrary(&mut unstructured).unwrap_or_default()
27565 }
27566}
27567impl Default for SCALED_PRESSURE3_DATA {
27568 fn default() -> Self {
27569 Self::DEFAULT.clone()
27570 }
27571}
27572impl MessageData for SCALED_PRESSURE3_DATA {
27573 type Message = MavMessage;
27574 const ID: u32 = 143u32;
27575 const NAME: &'static str = "SCALED_PRESSURE3";
27576 const EXTRA_CRC: u8 = 131u8;
27577 const ENCODED_LEN: usize = 16usize;
27578 fn deser(
27579 _version: MavlinkVersion,
27580 __input: &[u8],
27581 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27582 let avail_len = __input.len();
27583 let mut payload_buf = [0; Self::ENCODED_LEN];
27584 let mut buf = if avail_len < Self::ENCODED_LEN {
27585 payload_buf[0..avail_len].copy_from_slice(__input);
27586 Bytes::new(&payload_buf)
27587 } else {
27588 Bytes::new(__input)
27589 };
27590 let mut __struct = Self::default();
27591 __struct.time_boot_ms = buf.get_u32_le();
27592 __struct.press_abs = buf.get_f32_le();
27593 __struct.press_diff = buf.get_f32_le();
27594 __struct.temperature = buf.get_i16_le();
27595 __struct.temperature_press_diff = buf.get_i16_le();
27596 Ok(__struct)
27597 }
27598 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27599 let mut __tmp = BytesMut::new(bytes);
27600 #[allow(clippy::absurd_extreme_comparisons)]
27601 #[allow(unused_comparisons)]
27602 if __tmp.remaining() < Self::ENCODED_LEN {
27603 panic!(
27604 "buffer is too small (need {} bytes, but got {})",
27605 Self::ENCODED_LEN,
27606 __tmp.remaining(),
27607 )
27608 }
27609 __tmp.put_u32_le(self.time_boot_ms);
27610 __tmp.put_f32_le(self.press_abs);
27611 __tmp.put_f32_le(self.press_diff);
27612 __tmp.put_i16_le(self.temperature);
27613 if matches!(version, MavlinkVersion::V2) {
27614 __tmp.put_i16_le(self.temperature_press_diff);
27615 let len = __tmp.len();
27616 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27617 } else {
27618 __tmp.len()
27619 }
27620 }
27621}
27622#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27623#[doc = ""]
27624#[doc = "ID: 126"]
27625#[derive(Debug, Clone, PartialEq)]
27626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27628#[cfg_attr(feature = "ts", derive(TS))]
27629#[cfg_attr(feature = "ts", ts(export))]
27630pub struct SERIAL_CONTROL_DATA {
27631 #[doc = "Baudrate of transfer. Zero means no change."]
27632 pub baudrate: u32,
27633 #[doc = "Timeout for reply data"]
27634 pub timeout: u16,
27635 #[doc = "Serial control device type."]
27636 pub device: SerialControlDev,
27637 #[doc = "Bitmap of serial control flags."]
27638 pub flags: SerialControlFlag,
27639 #[doc = "how many bytes in this transfer"]
27640 pub count: u8,
27641 #[doc = "serial data"]
27642 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27643 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27644 pub data: [u8; 70],
27645 #[doc = "System ID"]
27646 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27647 pub target_system: u8,
27648 #[doc = "Component ID"]
27649 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27650 pub target_component: u8,
27651}
27652impl SERIAL_CONTROL_DATA {
27653 pub const ENCODED_LEN: usize = 81usize;
27654 pub const DEFAULT: Self = Self {
27655 baudrate: 0_u32,
27656 timeout: 0_u16,
27657 device: SerialControlDev::DEFAULT,
27658 flags: SerialControlFlag::DEFAULT,
27659 count: 0_u8,
27660 data: [0_u8; 70usize],
27661 target_system: 0_u8,
27662 target_component: 0_u8,
27663 };
27664 #[cfg(feature = "arbitrary")]
27665 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27666 use arbitrary::{Arbitrary, Unstructured};
27667 let mut buf = [0u8; 1024];
27668 rng.fill_bytes(&mut buf);
27669 let mut unstructured = Unstructured::new(&buf);
27670 Self::arbitrary(&mut unstructured).unwrap_or_default()
27671 }
27672}
27673impl Default for SERIAL_CONTROL_DATA {
27674 fn default() -> Self {
27675 Self::DEFAULT.clone()
27676 }
27677}
27678impl MessageData for SERIAL_CONTROL_DATA {
27679 type Message = MavMessage;
27680 const ID: u32 = 126u32;
27681 const NAME: &'static str = "SERIAL_CONTROL";
27682 const EXTRA_CRC: u8 = 220u8;
27683 const ENCODED_LEN: usize = 81usize;
27684 fn deser(
27685 _version: MavlinkVersion,
27686 __input: &[u8],
27687 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27688 let avail_len = __input.len();
27689 let mut payload_buf = [0; Self::ENCODED_LEN];
27690 let mut buf = if avail_len < Self::ENCODED_LEN {
27691 payload_buf[0..avail_len].copy_from_slice(__input);
27692 Bytes::new(&payload_buf)
27693 } else {
27694 Bytes::new(__input)
27695 };
27696 let mut __struct = Self::default();
27697 __struct.baudrate = buf.get_u32_le();
27698 __struct.timeout = buf.get_u16_le();
27699 let tmp = buf.get_u8();
27700 __struct.device =
27701 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27702 enum_type: "SerialControlDev",
27703 value: tmp as u32,
27704 })?;
27705 let tmp = buf.get_u8();
27706 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
27707 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27708 flag_type: "SerialControlFlag",
27709 value: tmp as u32,
27710 })?;
27711 __struct.count = buf.get_u8();
27712 for v in &mut __struct.data {
27713 let val = buf.get_u8();
27714 *v = val;
27715 }
27716 __struct.target_system = buf.get_u8();
27717 __struct.target_component = buf.get_u8();
27718 Ok(__struct)
27719 }
27720 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27721 let mut __tmp = BytesMut::new(bytes);
27722 #[allow(clippy::absurd_extreme_comparisons)]
27723 #[allow(unused_comparisons)]
27724 if __tmp.remaining() < Self::ENCODED_LEN {
27725 panic!(
27726 "buffer is too small (need {} bytes, but got {})",
27727 Self::ENCODED_LEN,
27728 __tmp.remaining(),
27729 )
27730 }
27731 __tmp.put_u32_le(self.baudrate);
27732 __tmp.put_u16_le(self.timeout);
27733 __tmp.put_u8(self.device as u8);
27734 __tmp.put_u8(self.flags.bits());
27735 __tmp.put_u8(self.count);
27736 for val in &self.data {
27737 __tmp.put_u8(*val);
27738 }
27739 if matches!(version, MavlinkVersion::V2) {
27740 __tmp.put_u8(self.target_system);
27741 __tmp.put_u8(self.target_component);
27742 let len = __tmp.len();
27743 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27744 } else {
27745 __tmp.len()
27746 }
27747 }
27748}
27749#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
27750#[doc = ""]
27751#[doc = "ID: 36"]
27752#[derive(Debug, Clone, PartialEq)]
27753#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27754#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27755#[cfg_attr(feature = "ts", derive(TS))]
27756#[cfg_attr(feature = "ts", ts(export))]
27757pub struct SERVO_OUTPUT_RAW_DATA {
27758 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27759 pub time_usec: u32,
27760 #[doc = "Servo output 1 value"]
27761 pub servo1_raw: u16,
27762 #[doc = "Servo output 2 value"]
27763 pub servo2_raw: u16,
27764 #[doc = "Servo output 3 value"]
27765 pub servo3_raw: u16,
27766 #[doc = "Servo output 4 value"]
27767 pub servo4_raw: u16,
27768 #[doc = "Servo output 5 value"]
27769 pub servo5_raw: u16,
27770 #[doc = "Servo output 6 value"]
27771 pub servo6_raw: u16,
27772 #[doc = "Servo output 7 value"]
27773 pub servo7_raw: u16,
27774 #[doc = "Servo output 8 value"]
27775 pub servo8_raw: u16,
27776 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27777 pub port: u8,
27778 #[doc = "Servo output 9 value"]
27779 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27780 pub servo9_raw: u16,
27781 #[doc = "Servo output 10 value"]
27782 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27783 pub servo10_raw: u16,
27784 #[doc = "Servo output 11 value"]
27785 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27786 pub servo11_raw: u16,
27787 #[doc = "Servo output 12 value"]
27788 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27789 pub servo12_raw: u16,
27790 #[doc = "Servo output 13 value"]
27791 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27792 pub servo13_raw: u16,
27793 #[doc = "Servo output 14 value"]
27794 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27795 pub servo14_raw: u16,
27796 #[doc = "Servo output 15 value"]
27797 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27798 pub servo15_raw: u16,
27799 #[doc = "Servo output 16 value"]
27800 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27801 pub servo16_raw: u16,
27802}
27803impl SERVO_OUTPUT_RAW_DATA {
27804 pub const ENCODED_LEN: usize = 37usize;
27805 pub const DEFAULT: Self = Self {
27806 time_usec: 0_u32,
27807 servo1_raw: 0_u16,
27808 servo2_raw: 0_u16,
27809 servo3_raw: 0_u16,
27810 servo4_raw: 0_u16,
27811 servo5_raw: 0_u16,
27812 servo6_raw: 0_u16,
27813 servo7_raw: 0_u16,
27814 servo8_raw: 0_u16,
27815 port: 0_u8,
27816 servo9_raw: 0_u16,
27817 servo10_raw: 0_u16,
27818 servo11_raw: 0_u16,
27819 servo12_raw: 0_u16,
27820 servo13_raw: 0_u16,
27821 servo14_raw: 0_u16,
27822 servo15_raw: 0_u16,
27823 servo16_raw: 0_u16,
27824 };
27825 #[cfg(feature = "arbitrary")]
27826 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27827 use arbitrary::{Arbitrary, Unstructured};
27828 let mut buf = [0u8; 1024];
27829 rng.fill_bytes(&mut buf);
27830 let mut unstructured = Unstructured::new(&buf);
27831 Self::arbitrary(&mut unstructured).unwrap_or_default()
27832 }
27833}
27834impl Default for SERVO_OUTPUT_RAW_DATA {
27835 fn default() -> Self {
27836 Self::DEFAULT.clone()
27837 }
27838}
27839impl MessageData for SERVO_OUTPUT_RAW_DATA {
27840 type Message = MavMessage;
27841 const ID: u32 = 36u32;
27842 const NAME: &'static str = "SERVO_OUTPUT_RAW";
27843 const EXTRA_CRC: u8 = 222u8;
27844 const ENCODED_LEN: usize = 37usize;
27845 fn deser(
27846 _version: MavlinkVersion,
27847 __input: &[u8],
27848 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27849 let avail_len = __input.len();
27850 let mut payload_buf = [0; Self::ENCODED_LEN];
27851 let mut buf = if avail_len < Self::ENCODED_LEN {
27852 payload_buf[0..avail_len].copy_from_slice(__input);
27853 Bytes::new(&payload_buf)
27854 } else {
27855 Bytes::new(__input)
27856 };
27857 let mut __struct = Self::default();
27858 __struct.time_usec = buf.get_u32_le();
27859 __struct.servo1_raw = buf.get_u16_le();
27860 __struct.servo2_raw = buf.get_u16_le();
27861 __struct.servo3_raw = buf.get_u16_le();
27862 __struct.servo4_raw = buf.get_u16_le();
27863 __struct.servo5_raw = buf.get_u16_le();
27864 __struct.servo6_raw = buf.get_u16_le();
27865 __struct.servo7_raw = buf.get_u16_le();
27866 __struct.servo8_raw = buf.get_u16_le();
27867 __struct.port = buf.get_u8();
27868 __struct.servo9_raw = buf.get_u16_le();
27869 __struct.servo10_raw = buf.get_u16_le();
27870 __struct.servo11_raw = buf.get_u16_le();
27871 __struct.servo12_raw = buf.get_u16_le();
27872 __struct.servo13_raw = buf.get_u16_le();
27873 __struct.servo14_raw = buf.get_u16_le();
27874 __struct.servo15_raw = buf.get_u16_le();
27875 __struct.servo16_raw = buf.get_u16_le();
27876 Ok(__struct)
27877 }
27878 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27879 let mut __tmp = BytesMut::new(bytes);
27880 #[allow(clippy::absurd_extreme_comparisons)]
27881 #[allow(unused_comparisons)]
27882 if __tmp.remaining() < Self::ENCODED_LEN {
27883 panic!(
27884 "buffer is too small (need {} bytes, but got {})",
27885 Self::ENCODED_LEN,
27886 __tmp.remaining(),
27887 )
27888 }
27889 __tmp.put_u32_le(self.time_usec);
27890 __tmp.put_u16_le(self.servo1_raw);
27891 __tmp.put_u16_le(self.servo2_raw);
27892 __tmp.put_u16_le(self.servo3_raw);
27893 __tmp.put_u16_le(self.servo4_raw);
27894 __tmp.put_u16_le(self.servo5_raw);
27895 __tmp.put_u16_le(self.servo6_raw);
27896 __tmp.put_u16_le(self.servo7_raw);
27897 __tmp.put_u16_le(self.servo8_raw);
27898 __tmp.put_u8(self.port);
27899 if matches!(version, MavlinkVersion::V2) {
27900 __tmp.put_u16_le(self.servo9_raw);
27901 __tmp.put_u16_le(self.servo10_raw);
27902 __tmp.put_u16_le(self.servo11_raw);
27903 __tmp.put_u16_le(self.servo12_raw);
27904 __tmp.put_u16_le(self.servo13_raw);
27905 __tmp.put_u16_le(self.servo14_raw);
27906 __tmp.put_u16_le(self.servo15_raw);
27907 __tmp.put_u16_le(self.servo16_raw);
27908 let len = __tmp.len();
27909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27910 } else {
27911 __tmp.len()
27912 }
27913 }
27914}
27915#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
27916#[doc = ""]
27917#[doc = "ID: 256"]
27918#[derive(Debug, Clone, PartialEq)]
27919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27921#[cfg_attr(feature = "ts", derive(TS))]
27922#[cfg_attr(feature = "ts", ts(export))]
27923pub struct SETUP_SIGNING_DATA {
27924 #[doc = "initial timestamp"]
27925 pub initial_timestamp: u64,
27926 #[doc = "system id of the target"]
27927 pub target_system: u8,
27928 #[doc = "component ID of the target"]
27929 pub target_component: u8,
27930 #[doc = "signing key"]
27931 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27932 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27933 pub secret_key: [u8; 32],
27934}
27935impl SETUP_SIGNING_DATA {
27936 pub const ENCODED_LEN: usize = 42usize;
27937 pub const DEFAULT: Self = Self {
27938 initial_timestamp: 0_u64,
27939 target_system: 0_u8,
27940 target_component: 0_u8,
27941 secret_key: [0_u8; 32usize],
27942 };
27943 #[cfg(feature = "arbitrary")]
27944 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27945 use arbitrary::{Arbitrary, Unstructured};
27946 let mut buf = [0u8; 1024];
27947 rng.fill_bytes(&mut buf);
27948 let mut unstructured = Unstructured::new(&buf);
27949 Self::arbitrary(&mut unstructured).unwrap_or_default()
27950 }
27951}
27952impl Default for SETUP_SIGNING_DATA {
27953 fn default() -> Self {
27954 Self::DEFAULT.clone()
27955 }
27956}
27957impl MessageData for SETUP_SIGNING_DATA {
27958 type Message = MavMessage;
27959 const ID: u32 = 256u32;
27960 const NAME: &'static str = "SETUP_SIGNING";
27961 const EXTRA_CRC: u8 = 71u8;
27962 const ENCODED_LEN: usize = 42usize;
27963 fn deser(
27964 _version: MavlinkVersion,
27965 __input: &[u8],
27966 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27967 let avail_len = __input.len();
27968 let mut payload_buf = [0; Self::ENCODED_LEN];
27969 let mut buf = if avail_len < Self::ENCODED_LEN {
27970 payload_buf[0..avail_len].copy_from_slice(__input);
27971 Bytes::new(&payload_buf)
27972 } else {
27973 Bytes::new(__input)
27974 };
27975 let mut __struct = Self::default();
27976 __struct.initial_timestamp = buf.get_u64_le();
27977 __struct.target_system = buf.get_u8();
27978 __struct.target_component = buf.get_u8();
27979 for v in &mut __struct.secret_key {
27980 let val = buf.get_u8();
27981 *v = val;
27982 }
27983 Ok(__struct)
27984 }
27985 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27986 let mut __tmp = BytesMut::new(bytes);
27987 #[allow(clippy::absurd_extreme_comparisons)]
27988 #[allow(unused_comparisons)]
27989 if __tmp.remaining() < Self::ENCODED_LEN {
27990 panic!(
27991 "buffer is too small (need {} bytes, but got {})",
27992 Self::ENCODED_LEN,
27993 __tmp.remaining(),
27994 )
27995 }
27996 __tmp.put_u64_le(self.initial_timestamp);
27997 __tmp.put_u8(self.target_system);
27998 __tmp.put_u8(self.target_component);
27999 for val in &self.secret_key {
28000 __tmp.put_u8(*val);
28001 }
28002 if matches!(version, MavlinkVersion::V2) {
28003 let len = __tmp.len();
28004 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28005 } else {
28006 __tmp.len()
28007 }
28008 }
28009}
28010#[doc = "Set the vehicle attitude and body angular rates."]
28011#[doc = ""]
28012#[doc = "ID: 139"]
28013#[derive(Debug, Clone, PartialEq)]
28014#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28015#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28016#[cfg_attr(feature = "ts", derive(TS))]
28017#[cfg_attr(feature = "ts", ts(export))]
28018pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
28019 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28020 pub time_usec: u64,
28021 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
28022 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28023 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28024 pub controls: [f32; 8],
28025 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
28026 pub group_mlx: u8,
28027 #[doc = "System ID"]
28028 pub target_system: u8,
28029 #[doc = "Component ID"]
28030 pub target_component: u8,
28031}
28032impl SET_ACTUATOR_CONTROL_TARGET_DATA {
28033 pub const ENCODED_LEN: usize = 43usize;
28034 pub const DEFAULT: Self = Self {
28035 time_usec: 0_u64,
28036 controls: [0.0_f32; 8usize],
28037 group_mlx: 0_u8,
28038 target_system: 0_u8,
28039 target_component: 0_u8,
28040 };
28041 #[cfg(feature = "arbitrary")]
28042 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28043 use arbitrary::{Arbitrary, Unstructured};
28044 let mut buf = [0u8; 1024];
28045 rng.fill_bytes(&mut buf);
28046 let mut unstructured = Unstructured::new(&buf);
28047 Self::arbitrary(&mut unstructured).unwrap_or_default()
28048 }
28049}
28050impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
28051 fn default() -> Self {
28052 Self::DEFAULT.clone()
28053 }
28054}
28055impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
28056 type Message = MavMessage;
28057 const ID: u32 = 139u32;
28058 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
28059 const EXTRA_CRC: u8 = 168u8;
28060 const ENCODED_LEN: usize = 43usize;
28061 fn deser(
28062 _version: MavlinkVersion,
28063 __input: &[u8],
28064 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28065 let avail_len = __input.len();
28066 let mut payload_buf = [0; Self::ENCODED_LEN];
28067 let mut buf = if avail_len < Self::ENCODED_LEN {
28068 payload_buf[0..avail_len].copy_from_slice(__input);
28069 Bytes::new(&payload_buf)
28070 } else {
28071 Bytes::new(__input)
28072 };
28073 let mut __struct = Self::default();
28074 __struct.time_usec = buf.get_u64_le();
28075 for v in &mut __struct.controls {
28076 let val = buf.get_f32_le();
28077 *v = val;
28078 }
28079 __struct.group_mlx = buf.get_u8();
28080 __struct.target_system = buf.get_u8();
28081 __struct.target_component = buf.get_u8();
28082 Ok(__struct)
28083 }
28084 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28085 let mut __tmp = BytesMut::new(bytes);
28086 #[allow(clippy::absurd_extreme_comparisons)]
28087 #[allow(unused_comparisons)]
28088 if __tmp.remaining() < Self::ENCODED_LEN {
28089 panic!(
28090 "buffer is too small (need {} bytes, but got {})",
28091 Self::ENCODED_LEN,
28092 __tmp.remaining(),
28093 )
28094 }
28095 __tmp.put_u64_le(self.time_usec);
28096 for val in &self.controls {
28097 __tmp.put_f32_le(*val);
28098 }
28099 __tmp.put_u8(self.group_mlx);
28100 __tmp.put_u8(self.target_system);
28101 __tmp.put_u8(self.target_component);
28102 if matches!(version, MavlinkVersion::V2) {
28103 let len = __tmp.len();
28104 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28105 } else {
28106 __tmp.len()
28107 }
28108 }
28109}
28110#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
28111#[doc = ""]
28112#[doc = "ID: 82"]
28113#[derive(Debug, Clone, PartialEq)]
28114#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28115#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28116#[cfg_attr(feature = "ts", derive(TS))]
28117#[cfg_attr(feature = "ts", ts(export))]
28118pub struct SET_ATTITUDE_TARGET_DATA {
28119 #[doc = "Timestamp (time since system boot)."]
28120 pub time_boot_ms: u32,
28121 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
28122 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28123 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28124 pub q: [f32; 4],
28125 #[doc = "Body roll rate"]
28126 pub body_roll_rate: f32,
28127 #[doc = "Body pitch rate"]
28128 pub body_pitch_rate: f32,
28129 #[doc = "Body yaw rate"]
28130 pub body_yaw_rate: f32,
28131 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
28132 pub thrust: f32,
28133 #[doc = "System ID"]
28134 pub target_system: u8,
28135 #[doc = "Component ID"]
28136 pub target_component: u8,
28137 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28138 pub type_mask: AttitudeTargetTypemask,
28139 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
28140 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28141 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28142 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28143 pub thrust_body: [f32; 3],
28144}
28145impl SET_ATTITUDE_TARGET_DATA {
28146 pub const ENCODED_LEN: usize = 51usize;
28147 pub const DEFAULT: Self = Self {
28148 time_boot_ms: 0_u32,
28149 q: [0.0_f32; 4usize],
28150 body_roll_rate: 0.0_f32,
28151 body_pitch_rate: 0.0_f32,
28152 body_yaw_rate: 0.0_f32,
28153 thrust: 0.0_f32,
28154 target_system: 0_u8,
28155 target_component: 0_u8,
28156 type_mask: AttitudeTargetTypemask::DEFAULT,
28157 thrust_body: [0.0_f32; 3usize],
28158 };
28159 #[cfg(feature = "arbitrary")]
28160 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28161 use arbitrary::{Arbitrary, Unstructured};
28162 let mut buf = [0u8; 1024];
28163 rng.fill_bytes(&mut buf);
28164 let mut unstructured = Unstructured::new(&buf);
28165 Self::arbitrary(&mut unstructured).unwrap_or_default()
28166 }
28167}
28168impl Default for SET_ATTITUDE_TARGET_DATA {
28169 fn default() -> Self {
28170 Self::DEFAULT.clone()
28171 }
28172}
28173impl MessageData for SET_ATTITUDE_TARGET_DATA {
28174 type Message = MavMessage;
28175 const ID: u32 = 82u32;
28176 const NAME: &'static str = "SET_ATTITUDE_TARGET";
28177 const EXTRA_CRC: u8 = 49u8;
28178 const ENCODED_LEN: usize = 51usize;
28179 fn deser(
28180 _version: MavlinkVersion,
28181 __input: &[u8],
28182 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28183 let avail_len = __input.len();
28184 let mut payload_buf = [0; Self::ENCODED_LEN];
28185 let mut buf = if avail_len < Self::ENCODED_LEN {
28186 payload_buf[0..avail_len].copy_from_slice(__input);
28187 Bytes::new(&payload_buf)
28188 } else {
28189 Bytes::new(__input)
28190 };
28191 let mut __struct = Self::default();
28192 __struct.time_boot_ms = buf.get_u32_le();
28193 for v in &mut __struct.q {
28194 let val = buf.get_f32_le();
28195 *v = val;
28196 }
28197 __struct.body_roll_rate = buf.get_f32_le();
28198 __struct.body_pitch_rate = buf.get_f32_le();
28199 __struct.body_yaw_rate = buf.get_f32_le();
28200 __struct.thrust = buf.get_f32_le();
28201 __struct.target_system = buf.get_u8();
28202 __struct.target_component = buf.get_u8();
28203 let tmp = buf.get_u8();
28204 __struct.type_mask = AttitudeTargetTypemask::from_bits(
28205 tmp & AttitudeTargetTypemask::all().bits(),
28206 )
28207 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28208 flag_type: "AttitudeTargetTypemask",
28209 value: tmp as u32,
28210 })?;
28211 for v in &mut __struct.thrust_body {
28212 let val = buf.get_f32_le();
28213 *v = val;
28214 }
28215 Ok(__struct)
28216 }
28217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28218 let mut __tmp = BytesMut::new(bytes);
28219 #[allow(clippy::absurd_extreme_comparisons)]
28220 #[allow(unused_comparisons)]
28221 if __tmp.remaining() < Self::ENCODED_LEN {
28222 panic!(
28223 "buffer is too small (need {} bytes, but got {})",
28224 Self::ENCODED_LEN,
28225 __tmp.remaining(),
28226 )
28227 }
28228 __tmp.put_u32_le(self.time_boot_ms);
28229 for val in &self.q {
28230 __tmp.put_f32_le(*val);
28231 }
28232 __tmp.put_f32_le(self.body_roll_rate);
28233 __tmp.put_f32_le(self.body_pitch_rate);
28234 __tmp.put_f32_le(self.body_yaw_rate);
28235 __tmp.put_f32_le(self.thrust);
28236 __tmp.put_u8(self.target_system);
28237 __tmp.put_u8(self.target_component);
28238 __tmp.put_u8(self.type_mask.bits());
28239 if matches!(version, MavlinkVersion::V2) {
28240 for val in &self.thrust_body {
28241 __tmp.put_f32_le(*val);
28242 }
28243 let len = __tmp.len();
28244 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28245 } else {
28246 __tmp.len()
28247 }
28248 }
28249}
28250#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
28251#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
28252#[doc = ""]
28253#[doc = "ID: 48"]
28254#[derive(Debug, Clone, PartialEq)]
28255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28257#[cfg_attr(feature = "ts", derive(TS))]
28258#[cfg_attr(feature = "ts", ts(export))]
28259pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
28260 #[doc = "Latitude (WGS84)"]
28261 pub latitude: i32,
28262 #[doc = "Longitude (WGS84)"]
28263 pub longitude: i32,
28264 #[doc = "Altitude (MSL). Positive for up."]
28265 pub altitude: i32,
28266 #[doc = "System ID"]
28267 pub target_system: u8,
28268 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28269 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28270 pub time_usec: u64,
28271}
28272impl SET_GPS_GLOBAL_ORIGIN_DATA {
28273 pub const ENCODED_LEN: usize = 21usize;
28274 pub const DEFAULT: Self = Self {
28275 latitude: 0_i32,
28276 longitude: 0_i32,
28277 altitude: 0_i32,
28278 target_system: 0_u8,
28279 time_usec: 0_u64,
28280 };
28281 #[cfg(feature = "arbitrary")]
28282 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28283 use arbitrary::{Arbitrary, Unstructured};
28284 let mut buf = [0u8; 1024];
28285 rng.fill_bytes(&mut buf);
28286 let mut unstructured = Unstructured::new(&buf);
28287 Self::arbitrary(&mut unstructured).unwrap_or_default()
28288 }
28289}
28290impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
28291 fn default() -> Self {
28292 Self::DEFAULT.clone()
28293 }
28294}
28295impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
28296 type Message = MavMessage;
28297 const ID: u32 = 48u32;
28298 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
28299 const EXTRA_CRC: u8 = 41u8;
28300 const ENCODED_LEN: usize = 21usize;
28301 fn deser(
28302 _version: MavlinkVersion,
28303 __input: &[u8],
28304 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28305 let avail_len = __input.len();
28306 let mut payload_buf = [0; Self::ENCODED_LEN];
28307 let mut buf = if avail_len < Self::ENCODED_LEN {
28308 payload_buf[0..avail_len].copy_from_slice(__input);
28309 Bytes::new(&payload_buf)
28310 } else {
28311 Bytes::new(__input)
28312 };
28313 let mut __struct = Self::default();
28314 __struct.latitude = buf.get_i32_le();
28315 __struct.longitude = buf.get_i32_le();
28316 __struct.altitude = buf.get_i32_le();
28317 __struct.target_system = buf.get_u8();
28318 __struct.time_usec = buf.get_u64_le();
28319 Ok(__struct)
28320 }
28321 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28322 let mut __tmp = BytesMut::new(bytes);
28323 #[allow(clippy::absurd_extreme_comparisons)]
28324 #[allow(unused_comparisons)]
28325 if __tmp.remaining() < Self::ENCODED_LEN {
28326 panic!(
28327 "buffer is too small (need {} bytes, but got {})",
28328 Self::ENCODED_LEN,
28329 __tmp.remaining(),
28330 )
28331 }
28332 __tmp.put_i32_le(self.latitude);
28333 __tmp.put_i32_le(self.longitude);
28334 __tmp.put_i32_le(self.altitude);
28335 __tmp.put_u8(self.target_system);
28336 if matches!(version, MavlinkVersion::V2) {
28337 __tmp.put_u64_le(self.time_usec);
28338 let len = __tmp.len();
28339 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28340 } else {
28341 __tmp.len()
28342 }
28343 }
28344}
28345#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
28346#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
28347#[doc = ""]
28348#[doc = "ID: 243"]
28349#[derive(Debug, Clone, PartialEq)]
28350#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28352#[cfg_attr(feature = "ts", derive(TS))]
28353#[cfg_attr(feature = "ts", ts(export))]
28354pub struct SET_HOME_POSITION_DATA {
28355 #[doc = "Latitude (WGS84)"]
28356 pub latitude: i32,
28357 #[doc = "Longitude (WGS84)"]
28358 pub longitude: i32,
28359 #[doc = "Altitude (MSL). Positive for up."]
28360 pub altitude: i32,
28361 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
28362 pub x: f32,
28363 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
28364 pub y: f32,
28365 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
28366 pub z: f32,
28367 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
28368 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28369 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28370 pub q: [f32; 4],
28371 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28372 pub approach_x: f32,
28373 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28374 pub approach_y: f32,
28375 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28376 pub approach_z: f32,
28377 #[doc = "System ID."]
28378 pub target_system: u8,
28379 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28380 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28381 pub time_usec: u64,
28382}
28383impl SET_HOME_POSITION_DATA {
28384 pub const ENCODED_LEN: usize = 61usize;
28385 pub const DEFAULT: Self = Self {
28386 latitude: 0_i32,
28387 longitude: 0_i32,
28388 altitude: 0_i32,
28389 x: 0.0_f32,
28390 y: 0.0_f32,
28391 z: 0.0_f32,
28392 q: [0.0_f32; 4usize],
28393 approach_x: 0.0_f32,
28394 approach_y: 0.0_f32,
28395 approach_z: 0.0_f32,
28396 target_system: 0_u8,
28397 time_usec: 0_u64,
28398 };
28399 #[cfg(feature = "arbitrary")]
28400 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28401 use arbitrary::{Arbitrary, Unstructured};
28402 let mut buf = [0u8; 1024];
28403 rng.fill_bytes(&mut buf);
28404 let mut unstructured = Unstructured::new(&buf);
28405 Self::arbitrary(&mut unstructured).unwrap_or_default()
28406 }
28407}
28408impl Default for SET_HOME_POSITION_DATA {
28409 fn default() -> Self {
28410 Self::DEFAULT.clone()
28411 }
28412}
28413impl MessageData for SET_HOME_POSITION_DATA {
28414 type Message = MavMessage;
28415 const ID: u32 = 243u32;
28416 const NAME: &'static str = "SET_HOME_POSITION";
28417 const EXTRA_CRC: u8 = 85u8;
28418 const ENCODED_LEN: usize = 61usize;
28419 fn deser(
28420 _version: MavlinkVersion,
28421 __input: &[u8],
28422 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28423 let avail_len = __input.len();
28424 let mut payload_buf = [0; Self::ENCODED_LEN];
28425 let mut buf = if avail_len < Self::ENCODED_LEN {
28426 payload_buf[0..avail_len].copy_from_slice(__input);
28427 Bytes::new(&payload_buf)
28428 } else {
28429 Bytes::new(__input)
28430 };
28431 let mut __struct = Self::default();
28432 __struct.latitude = buf.get_i32_le();
28433 __struct.longitude = buf.get_i32_le();
28434 __struct.altitude = buf.get_i32_le();
28435 __struct.x = buf.get_f32_le();
28436 __struct.y = buf.get_f32_le();
28437 __struct.z = buf.get_f32_le();
28438 for v in &mut __struct.q {
28439 let val = buf.get_f32_le();
28440 *v = val;
28441 }
28442 __struct.approach_x = buf.get_f32_le();
28443 __struct.approach_y = buf.get_f32_le();
28444 __struct.approach_z = buf.get_f32_le();
28445 __struct.target_system = buf.get_u8();
28446 __struct.time_usec = buf.get_u64_le();
28447 Ok(__struct)
28448 }
28449 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28450 let mut __tmp = BytesMut::new(bytes);
28451 #[allow(clippy::absurd_extreme_comparisons)]
28452 #[allow(unused_comparisons)]
28453 if __tmp.remaining() < Self::ENCODED_LEN {
28454 panic!(
28455 "buffer is too small (need {} bytes, but got {})",
28456 Self::ENCODED_LEN,
28457 __tmp.remaining(),
28458 )
28459 }
28460 __tmp.put_i32_le(self.latitude);
28461 __tmp.put_i32_le(self.longitude);
28462 __tmp.put_i32_le(self.altitude);
28463 __tmp.put_f32_le(self.x);
28464 __tmp.put_f32_le(self.y);
28465 __tmp.put_f32_le(self.z);
28466 for val in &self.q {
28467 __tmp.put_f32_le(*val);
28468 }
28469 __tmp.put_f32_le(self.approach_x);
28470 __tmp.put_f32_le(self.approach_y);
28471 __tmp.put_f32_le(self.approach_z);
28472 __tmp.put_u8(self.target_system);
28473 if matches!(version, MavlinkVersion::V2) {
28474 __tmp.put_u64_le(self.time_usec);
28475 let len = __tmp.len();
28476 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28477 } else {
28478 __tmp.len()
28479 }
28480 }
28481}
28482#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
28483#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
28484#[doc = ""]
28485#[doc = "ID: 11"]
28486#[derive(Debug, Clone, PartialEq)]
28487#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28488#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28489#[cfg_attr(feature = "ts", derive(TS))]
28490#[cfg_attr(feature = "ts", ts(export))]
28491pub struct SET_MODE_DATA {
28492 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
28493 pub custom_mode: u32,
28494 #[doc = "The system setting the mode"]
28495 pub target_system: u8,
28496 #[doc = "The new base mode."]
28497 pub base_mode: MavMode,
28498}
28499impl SET_MODE_DATA {
28500 pub const ENCODED_LEN: usize = 6usize;
28501 pub const DEFAULT: Self = Self {
28502 custom_mode: 0_u32,
28503 target_system: 0_u8,
28504 base_mode: MavMode::DEFAULT,
28505 };
28506 #[cfg(feature = "arbitrary")]
28507 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28508 use arbitrary::{Arbitrary, Unstructured};
28509 let mut buf = [0u8; 1024];
28510 rng.fill_bytes(&mut buf);
28511 let mut unstructured = Unstructured::new(&buf);
28512 Self::arbitrary(&mut unstructured).unwrap_or_default()
28513 }
28514}
28515impl Default for SET_MODE_DATA {
28516 fn default() -> Self {
28517 Self::DEFAULT.clone()
28518 }
28519}
28520impl MessageData for SET_MODE_DATA {
28521 type Message = MavMessage;
28522 const ID: u32 = 11u32;
28523 const NAME: &'static str = "SET_MODE";
28524 const EXTRA_CRC: u8 = 89u8;
28525 const ENCODED_LEN: usize = 6usize;
28526 fn deser(
28527 _version: MavlinkVersion,
28528 __input: &[u8],
28529 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28530 let avail_len = __input.len();
28531 let mut payload_buf = [0; Self::ENCODED_LEN];
28532 let mut buf = if avail_len < Self::ENCODED_LEN {
28533 payload_buf[0..avail_len].copy_from_slice(__input);
28534 Bytes::new(&payload_buf)
28535 } else {
28536 Bytes::new(__input)
28537 };
28538 let mut __struct = Self::default();
28539 __struct.custom_mode = buf.get_u32_le();
28540 __struct.target_system = buf.get_u8();
28541 let tmp = buf.get_u8();
28542 __struct.base_mode =
28543 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28544 enum_type: "MavMode",
28545 value: tmp as u32,
28546 })?;
28547 Ok(__struct)
28548 }
28549 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28550 let mut __tmp = BytesMut::new(bytes);
28551 #[allow(clippy::absurd_extreme_comparisons)]
28552 #[allow(unused_comparisons)]
28553 if __tmp.remaining() < Self::ENCODED_LEN {
28554 panic!(
28555 "buffer is too small (need {} bytes, but got {})",
28556 Self::ENCODED_LEN,
28557 __tmp.remaining(),
28558 )
28559 }
28560 __tmp.put_u32_le(self.custom_mode);
28561 __tmp.put_u8(self.target_system);
28562 __tmp.put_u8(self.base_mode as u8);
28563 if matches!(version, MavlinkVersion::V2) {
28564 let len = __tmp.len();
28565 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28566 } else {
28567 __tmp.len()
28568 }
28569 }
28570}
28571#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
28572#[doc = ""]
28573#[doc = "ID: 86"]
28574#[derive(Debug, Clone, PartialEq)]
28575#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28576#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28577#[cfg_attr(feature = "ts", derive(TS))]
28578#[cfg_attr(feature = "ts", ts(export))]
28579pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
28580 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
28581 pub time_boot_ms: u32,
28582 #[doc = "Latitude in WGS84 frame"]
28583 pub lat_int: i32,
28584 #[doc = "Longitude in WGS84 frame"]
28585 pub lon_int: i32,
28586 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
28587 pub alt: f32,
28588 #[doc = "X velocity in NED frame"]
28589 pub vx: f32,
28590 #[doc = "Y velocity in NED frame"]
28591 pub vy: f32,
28592 #[doc = "Z velocity in NED frame"]
28593 pub vz: f32,
28594 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28595 pub afx: f32,
28596 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28597 pub afy: f32,
28598 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28599 pub afz: f32,
28600 #[doc = "yaw setpoint"]
28601 pub yaw: f32,
28602 #[doc = "yaw rate setpoint"]
28603 pub yaw_rate: f32,
28604 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28605 pub type_mask: PositionTargetTypemask,
28606 #[doc = "System ID"]
28607 pub target_system: u8,
28608 #[doc = "Component ID"]
28609 pub target_component: u8,
28610 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28611 pub coordinate_frame: MavFrame,
28612}
28613impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28614 pub const ENCODED_LEN: usize = 53usize;
28615 pub const DEFAULT: Self = Self {
28616 time_boot_ms: 0_u32,
28617 lat_int: 0_i32,
28618 lon_int: 0_i32,
28619 alt: 0.0_f32,
28620 vx: 0.0_f32,
28621 vy: 0.0_f32,
28622 vz: 0.0_f32,
28623 afx: 0.0_f32,
28624 afy: 0.0_f32,
28625 afz: 0.0_f32,
28626 yaw: 0.0_f32,
28627 yaw_rate: 0.0_f32,
28628 type_mask: PositionTargetTypemask::DEFAULT,
28629 target_system: 0_u8,
28630 target_component: 0_u8,
28631 coordinate_frame: MavFrame::DEFAULT,
28632 };
28633 #[cfg(feature = "arbitrary")]
28634 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28635 use arbitrary::{Arbitrary, Unstructured};
28636 let mut buf = [0u8; 1024];
28637 rng.fill_bytes(&mut buf);
28638 let mut unstructured = Unstructured::new(&buf);
28639 Self::arbitrary(&mut unstructured).unwrap_or_default()
28640 }
28641}
28642impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28643 fn default() -> Self {
28644 Self::DEFAULT.clone()
28645 }
28646}
28647impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28648 type Message = MavMessage;
28649 const ID: u32 = 86u32;
28650 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28651 const EXTRA_CRC: u8 = 5u8;
28652 const ENCODED_LEN: usize = 53usize;
28653 fn deser(
28654 _version: MavlinkVersion,
28655 __input: &[u8],
28656 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28657 let avail_len = __input.len();
28658 let mut payload_buf = [0; Self::ENCODED_LEN];
28659 let mut buf = if avail_len < Self::ENCODED_LEN {
28660 payload_buf[0..avail_len].copy_from_slice(__input);
28661 Bytes::new(&payload_buf)
28662 } else {
28663 Bytes::new(__input)
28664 };
28665 let mut __struct = Self::default();
28666 __struct.time_boot_ms = buf.get_u32_le();
28667 __struct.lat_int = buf.get_i32_le();
28668 __struct.lon_int = buf.get_i32_le();
28669 __struct.alt = buf.get_f32_le();
28670 __struct.vx = buf.get_f32_le();
28671 __struct.vy = buf.get_f32_le();
28672 __struct.vz = buf.get_f32_le();
28673 __struct.afx = buf.get_f32_le();
28674 __struct.afy = buf.get_f32_le();
28675 __struct.afz = buf.get_f32_le();
28676 __struct.yaw = buf.get_f32_le();
28677 __struct.yaw_rate = buf.get_f32_le();
28678 let tmp = buf.get_u16_le();
28679 __struct.type_mask = PositionTargetTypemask::from_bits(
28680 tmp & PositionTargetTypemask::all().bits(),
28681 )
28682 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28683 flag_type: "PositionTargetTypemask",
28684 value: tmp as u32,
28685 })?;
28686 __struct.target_system = buf.get_u8();
28687 __struct.target_component = buf.get_u8();
28688 let tmp = buf.get_u8();
28689 __struct.coordinate_frame =
28690 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28691 enum_type: "MavFrame",
28692 value: tmp as u32,
28693 })?;
28694 Ok(__struct)
28695 }
28696 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28697 let mut __tmp = BytesMut::new(bytes);
28698 #[allow(clippy::absurd_extreme_comparisons)]
28699 #[allow(unused_comparisons)]
28700 if __tmp.remaining() < Self::ENCODED_LEN {
28701 panic!(
28702 "buffer is too small (need {} bytes, but got {})",
28703 Self::ENCODED_LEN,
28704 __tmp.remaining(),
28705 )
28706 }
28707 __tmp.put_u32_le(self.time_boot_ms);
28708 __tmp.put_i32_le(self.lat_int);
28709 __tmp.put_i32_le(self.lon_int);
28710 __tmp.put_f32_le(self.alt);
28711 __tmp.put_f32_le(self.vx);
28712 __tmp.put_f32_le(self.vy);
28713 __tmp.put_f32_le(self.vz);
28714 __tmp.put_f32_le(self.afx);
28715 __tmp.put_f32_le(self.afy);
28716 __tmp.put_f32_le(self.afz);
28717 __tmp.put_f32_le(self.yaw);
28718 __tmp.put_f32_le(self.yaw_rate);
28719 __tmp.put_u16_le(self.type_mask.bits());
28720 __tmp.put_u8(self.target_system);
28721 __tmp.put_u8(self.target_component);
28722 __tmp.put_u8(self.coordinate_frame as u8);
28723 if matches!(version, MavlinkVersion::V2) {
28724 let len = __tmp.len();
28725 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28726 } else {
28727 __tmp.len()
28728 }
28729 }
28730}
28731#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
28732#[doc = ""]
28733#[doc = "ID: 84"]
28734#[derive(Debug, Clone, PartialEq)]
28735#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28736#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28737#[cfg_attr(feature = "ts", derive(TS))]
28738#[cfg_attr(feature = "ts", ts(export))]
28739pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
28740 #[doc = "Timestamp (time since system boot)."]
28741 pub time_boot_ms: u32,
28742 #[doc = "X Position in NED frame"]
28743 pub x: f32,
28744 #[doc = "Y Position in NED frame"]
28745 pub y: f32,
28746 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
28747 pub z: f32,
28748 #[doc = "X velocity in NED frame"]
28749 pub vx: f32,
28750 #[doc = "Y velocity in NED frame"]
28751 pub vy: f32,
28752 #[doc = "Z velocity in NED frame"]
28753 pub vz: f32,
28754 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28755 pub afx: f32,
28756 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28757 pub afy: f32,
28758 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28759 pub afz: f32,
28760 #[doc = "yaw setpoint"]
28761 pub yaw: f32,
28762 #[doc = "yaw rate setpoint"]
28763 pub yaw_rate: f32,
28764 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28765 pub type_mask: PositionTargetTypemask,
28766 #[doc = "System ID"]
28767 pub target_system: u8,
28768 #[doc = "Component ID"]
28769 pub target_component: u8,
28770 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
28771 pub coordinate_frame: MavFrame,
28772}
28773impl SET_POSITION_TARGET_LOCAL_NED_DATA {
28774 pub const ENCODED_LEN: usize = 53usize;
28775 pub const DEFAULT: Self = Self {
28776 time_boot_ms: 0_u32,
28777 x: 0.0_f32,
28778 y: 0.0_f32,
28779 z: 0.0_f32,
28780 vx: 0.0_f32,
28781 vy: 0.0_f32,
28782 vz: 0.0_f32,
28783 afx: 0.0_f32,
28784 afy: 0.0_f32,
28785 afz: 0.0_f32,
28786 yaw: 0.0_f32,
28787 yaw_rate: 0.0_f32,
28788 type_mask: PositionTargetTypemask::DEFAULT,
28789 target_system: 0_u8,
28790 target_component: 0_u8,
28791 coordinate_frame: MavFrame::DEFAULT,
28792 };
28793 #[cfg(feature = "arbitrary")]
28794 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28795 use arbitrary::{Arbitrary, Unstructured};
28796 let mut buf = [0u8; 1024];
28797 rng.fill_bytes(&mut buf);
28798 let mut unstructured = Unstructured::new(&buf);
28799 Self::arbitrary(&mut unstructured).unwrap_or_default()
28800 }
28801}
28802impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
28803 fn default() -> Self {
28804 Self::DEFAULT.clone()
28805 }
28806}
28807impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
28808 type Message = MavMessage;
28809 const ID: u32 = 84u32;
28810 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
28811 const EXTRA_CRC: u8 = 143u8;
28812 const ENCODED_LEN: usize = 53usize;
28813 fn deser(
28814 _version: MavlinkVersion,
28815 __input: &[u8],
28816 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28817 let avail_len = __input.len();
28818 let mut payload_buf = [0; Self::ENCODED_LEN];
28819 let mut buf = if avail_len < Self::ENCODED_LEN {
28820 payload_buf[0..avail_len].copy_from_slice(__input);
28821 Bytes::new(&payload_buf)
28822 } else {
28823 Bytes::new(__input)
28824 };
28825 let mut __struct = Self::default();
28826 __struct.time_boot_ms = buf.get_u32_le();
28827 __struct.x = buf.get_f32_le();
28828 __struct.y = buf.get_f32_le();
28829 __struct.z = buf.get_f32_le();
28830 __struct.vx = buf.get_f32_le();
28831 __struct.vy = buf.get_f32_le();
28832 __struct.vz = buf.get_f32_le();
28833 __struct.afx = buf.get_f32_le();
28834 __struct.afy = buf.get_f32_le();
28835 __struct.afz = buf.get_f32_le();
28836 __struct.yaw = buf.get_f32_le();
28837 __struct.yaw_rate = buf.get_f32_le();
28838 let tmp = buf.get_u16_le();
28839 __struct.type_mask = PositionTargetTypemask::from_bits(
28840 tmp & PositionTargetTypemask::all().bits(),
28841 )
28842 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28843 flag_type: "PositionTargetTypemask",
28844 value: tmp as u32,
28845 })?;
28846 __struct.target_system = buf.get_u8();
28847 __struct.target_component = buf.get_u8();
28848 let tmp = buf.get_u8();
28849 __struct.coordinate_frame =
28850 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28851 enum_type: "MavFrame",
28852 value: tmp as u32,
28853 })?;
28854 Ok(__struct)
28855 }
28856 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28857 let mut __tmp = BytesMut::new(bytes);
28858 #[allow(clippy::absurd_extreme_comparisons)]
28859 #[allow(unused_comparisons)]
28860 if __tmp.remaining() < Self::ENCODED_LEN {
28861 panic!(
28862 "buffer is too small (need {} bytes, but got {})",
28863 Self::ENCODED_LEN,
28864 __tmp.remaining(),
28865 )
28866 }
28867 __tmp.put_u32_le(self.time_boot_ms);
28868 __tmp.put_f32_le(self.x);
28869 __tmp.put_f32_le(self.y);
28870 __tmp.put_f32_le(self.z);
28871 __tmp.put_f32_le(self.vx);
28872 __tmp.put_f32_le(self.vy);
28873 __tmp.put_f32_le(self.vz);
28874 __tmp.put_f32_le(self.afx);
28875 __tmp.put_f32_le(self.afy);
28876 __tmp.put_f32_le(self.afz);
28877 __tmp.put_f32_le(self.yaw);
28878 __tmp.put_f32_le(self.yaw_rate);
28879 __tmp.put_u16_le(self.type_mask.bits());
28880 __tmp.put_u8(self.target_system);
28881 __tmp.put_u8(self.target_component);
28882 __tmp.put_u8(self.coordinate_frame as u8);
28883 if matches!(version, MavlinkVersion::V2) {
28884 let len = __tmp.len();
28885 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28886 } else {
28887 __tmp.len()
28888 }
28889 }
28890}
28891#[doc = "Status of simulation environment, if used."]
28892#[doc = ""]
28893#[doc = "ID: 108"]
28894#[derive(Debug, Clone, PartialEq)]
28895#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28896#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28897#[cfg_attr(feature = "ts", derive(TS))]
28898#[cfg_attr(feature = "ts", ts(export))]
28899pub struct SIM_STATE_DATA {
28900 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
28901 pub q1: f32,
28902 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
28903 pub q2: f32,
28904 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
28905 pub q3: f32,
28906 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
28907 pub q4: f32,
28908 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
28909 pub roll: f32,
28910 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
28911 pub pitch: f32,
28912 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
28913 pub yaw: f32,
28914 #[doc = "X acceleration"]
28915 pub xacc: f32,
28916 #[doc = "Y acceleration"]
28917 pub yacc: f32,
28918 #[doc = "Z acceleration"]
28919 pub zacc: f32,
28920 #[doc = "Angular speed around X axis"]
28921 pub xgyro: f32,
28922 #[doc = "Angular speed around Y axis"]
28923 pub ygyro: f32,
28924 #[doc = "Angular speed around Z axis"]
28925 pub zgyro: f32,
28926 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
28927 pub lat: f32,
28928 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
28929 pub lon: f32,
28930 #[doc = "Altitude"]
28931 pub alt: f32,
28932 #[doc = "Horizontal position standard deviation"]
28933 pub std_dev_horz: f32,
28934 #[doc = "Vertical position standard deviation"]
28935 pub std_dev_vert: f32,
28936 #[doc = "True velocity in north direction in earth-fixed NED frame"]
28937 pub vn: f32,
28938 #[doc = "True velocity in east direction in earth-fixed NED frame"]
28939 pub ve: f32,
28940 #[doc = "True velocity in down direction in earth-fixed NED frame"]
28941 pub vd: f32,
28942 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
28943 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28944 pub lat_int: i32,
28945 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
28946 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28947 pub lon_int: i32,
28948}
28949impl SIM_STATE_DATA {
28950 pub const ENCODED_LEN: usize = 92usize;
28951 pub const DEFAULT: Self = Self {
28952 q1: 0.0_f32,
28953 q2: 0.0_f32,
28954 q3: 0.0_f32,
28955 q4: 0.0_f32,
28956 roll: 0.0_f32,
28957 pitch: 0.0_f32,
28958 yaw: 0.0_f32,
28959 xacc: 0.0_f32,
28960 yacc: 0.0_f32,
28961 zacc: 0.0_f32,
28962 xgyro: 0.0_f32,
28963 ygyro: 0.0_f32,
28964 zgyro: 0.0_f32,
28965 lat: 0.0_f32,
28966 lon: 0.0_f32,
28967 alt: 0.0_f32,
28968 std_dev_horz: 0.0_f32,
28969 std_dev_vert: 0.0_f32,
28970 vn: 0.0_f32,
28971 ve: 0.0_f32,
28972 vd: 0.0_f32,
28973 lat_int: 0_i32,
28974 lon_int: 0_i32,
28975 };
28976 #[cfg(feature = "arbitrary")]
28977 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28978 use arbitrary::{Arbitrary, Unstructured};
28979 let mut buf = [0u8; 1024];
28980 rng.fill_bytes(&mut buf);
28981 let mut unstructured = Unstructured::new(&buf);
28982 Self::arbitrary(&mut unstructured).unwrap_or_default()
28983 }
28984}
28985impl Default for SIM_STATE_DATA {
28986 fn default() -> Self {
28987 Self::DEFAULT.clone()
28988 }
28989}
28990impl MessageData for SIM_STATE_DATA {
28991 type Message = MavMessage;
28992 const ID: u32 = 108u32;
28993 const NAME: &'static str = "SIM_STATE";
28994 const EXTRA_CRC: u8 = 32u8;
28995 const ENCODED_LEN: usize = 92usize;
28996 fn deser(
28997 _version: MavlinkVersion,
28998 __input: &[u8],
28999 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29000 let avail_len = __input.len();
29001 let mut payload_buf = [0; Self::ENCODED_LEN];
29002 let mut buf = if avail_len < Self::ENCODED_LEN {
29003 payload_buf[0..avail_len].copy_from_slice(__input);
29004 Bytes::new(&payload_buf)
29005 } else {
29006 Bytes::new(__input)
29007 };
29008 let mut __struct = Self::default();
29009 __struct.q1 = buf.get_f32_le();
29010 __struct.q2 = buf.get_f32_le();
29011 __struct.q3 = buf.get_f32_le();
29012 __struct.q4 = buf.get_f32_le();
29013 __struct.roll = buf.get_f32_le();
29014 __struct.pitch = buf.get_f32_le();
29015 __struct.yaw = buf.get_f32_le();
29016 __struct.xacc = buf.get_f32_le();
29017 __struct.yacc = buf.get_f32_le();
29018 __struct.zacc = buf.get_f32_le();
29019 __struct.xgyro = buf.get_f32_le();
29020 __struct.ygyro = buf.get_f32_le();
29021 __struct.zgyro = buf.get_f32_le();
29022 __struct.lat = buf.get_f32_le();
29023 __struct.lon = buf.get_f32_le();
29024 __struct.alt = buf.get_f32_le();
29025 __struct.std_dev_horz = buf.get_f32_le();
29026 __struct.std_dev_vert = buf.get_f32_le();
29027 __struct.vn = buf.get_f32_le();
29028 __struct.ve = buf.get_f32_le();
29029 __struct.vd = buf.get_f32_le();
29030 __struct.lat_int = buf.get_i32_le();
29031 __struct.lon_int = buf.get_i32_le();
29032 Ok(__struct)
29033 }
29034 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29035 let mut __tmp = BytesMut::new(bytes);
29036 #[allow(clippy::absurd_extreme_comparisons)]
29037 #[allow(unused_comparisons)]
29038 if __tmp.remaining() < Self::ENCODED_LEN {
29039 panic!(
29040 "buffer is too small (need {} bytes, but got {})",
29041 Self::ENCODED_LEN,
29042 __tmp.remaining(),
29043 )
29044 }
29045 __tmp.put_f32_le(self.q1);
29046 __tmp.put_f32_le(self.q2);
29047 __tmp.put_f32_le(self.q3);
29048 __tmp.put_f32_le(self.q4);
29049 __tmp.put_f32_le(self.roll);
29050 __tmp.put_f32_le(self.pitch);
29051 __tmp.put_f32_le(self.yaw);
29052 __tmp.put_f32_le(self.xacc);
29053 __tmp.put_f32_le(self.yacc);
29054 __tmp.put_f32_le(self.zacc);
29055 __tmp.put_f32_le(self.xgyro);
29056 __tmp.put_f32_le(self.ygyro);
29057 __tmp.put_f32_le(self.zgyro);
29058 __tmp.put_f32_le(self.lat);
29059 __tmp.put_f32_le(self.lon);
29060 __tmp.put_f32_le(self.alt);
29061 __tmp.put_f32_le(self.std_dev_horz);
29062 __tmp.put_f32_le(self.std_dev_vert);
29063 __tmp.put_f32_le(self.vn);
29064 __tmp.put_f32_le(self.ve);
29065 __tmp.put_f32_le(self.vd);
29066 if matches!(version, MavlinkVersion::V2) {
29067 __tmp.put_i32_le(self.lat_int);
29068 __tmp.put_i32_le(self.lon_int);
29069 let len = __tmp.len();
29070 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29071 } else {
29072 __tmp.len()
29073 }
29074 }
29075}
29076#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
29077#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
29078#[doc = ""]
29079#[doc = "ID: 370"]
29080#[derive(Debug, Clone, PartialEq)]
29081#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29082#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29083#[cfg_attr(feature = "ts", derive(TS))]
29084#[cfg_attr(feature = "ts", ts(export))]
29085pub struct SMART_BATTERY_INFO_DATA {
29086 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
29087 pub capacity_full_specification: i32,
29088 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
29089 pub capacity_full: i32,
29090 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
29091 pub cycle_count: u16,
29092 #[doc = "Battery weight. 0: field not provided."]
29093 pub weight: u16,
29094 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
29095 pub discharge_minimum_voltage: u16,
29096 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
29097 pub charging_minimum_voltage: u16,
29098 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
29099 pub resting_minimum_voltage: u16,
29100 #[doc = "Battery ID"]
29101 pub id: u8,
29102 #[doc = "Function of the battery"]
29103 pub battery_function: MavBatteryFunction,
29104 #[doc = "Type (chemistry) of the battery"]
29105 pub mavtype: MavBatteryType,
29106 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
29107 #[cfg_attr(
29108 feature = "serde",
29109 serde(
29110 serialize_with = "crate::nulstr::serialize::<_, 16>",
29111 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
29112 )
29113 )]
29114 #[cfg_attr(feature = "ts", ts(type = "string"))]
29115 pub serial_number: [u8; 16],
29116 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
29117 #[cfg_attr(
29118 feature = "serde",
29119 serde(
29120 serialize_with = "crate::nulstr::serialize::<_, 50>",
29121 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
29122 )
29123 )]
29124 #[cfg_attr(feature = "ts", ts(type = "string"))]
29125 pub device_name: [u8; 50],
29126 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
29127 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29128 pub charging_maximum_voltage: u16,
29129 #[doc = "Number of battery cells in series. 0: field not provided."]
29130 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29131 pub cells_in_series: u8,
29132 #[doc = "Maximum pack discharge current. 0: field not provided."]
29133 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29134 pub discharge_maximum_current: u32,
29135 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
29136 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29137 pub discharge_maximum_burst_current: u32,
29138 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
29139 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29140 #[cfg_attr(
29141 feature = "serde",
29142 serde(
29143 serialize_with = "crate::nulstr::serialize::<_, 11>",
29144 deserialize_with = "crate::nulstr::deserialize::<_, 11>"
29145 )
29146 )]
29147 #[cfg_attr(feature = "ts", ts(type = "string"))]
29148 pub manufacture_date: [u8; 11],
29149}
29150impl SMART_BATTERY_INFO_DATA {
29151 pub const ENCODED_LEN: usize = 109usize;
29152 pub const DEFAULT: Self = Self {
29153 capacity_full_specification: 0_i32,
29154 capacity_full: 0_i32,
29155 cycle_count: 0_u16,
29156 weight: 0_u16,
29157 discharge_minimum_voltage: 0_u16,
29158 charging_minimum_voltage: 0_u16,
29159 resting_minimum_voltage: 0_u16,
29160 id: 0_u8,
29161 battery_function: MavBatteryFunction::DEFAULT,
29162 mavtype: MavBatteryType::DEFAULT,
29163 serial_number: [0_u8; 16usize],
29164 device_name: [0_u8; 50usize],
29165 charging_maximum_voltage: 0_u16,
29166 cells_in_series: 0_u8,
29167 discharge_maximum_current: 0_u32,
29168 discharge_maximum_burst_current: 0_u32,
29169 manufacture_date: [0_u8; 11usize],
29170 };
29171 #[cfg(feature = "arbitrary")]
29172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29173 use arbitrary::{Arbitrary, Unstructured};
29174 let mut buf = [0u8; 1024];
29175 rng.fill_bytes(&mut buf);
29176 let mut unstructured = Unstructured::new(&buf);
29177 Self::arbitrary(&mut unstructured).unwrap_or_default()
29178 }
29179}
29180impl Default for SMART_BATTERY_INFO_DATA {
29181 fn default() -> Self {
29182 Self::DEFAULT.clone()
29183 }
29184}
29185impl MessageData for SMART_BATTERY_INFO_DATA {
29186 type Message = MavMessage;
29187 const ID: u32 = 370u32;
29188 const NAME: &'static str = "SMART_BATTERY_INFO";
29189 const EXTRA_CRC: u8 = 75u8;
29190 const ENCODED_LEN: usize = 109usize;
29191 fn deser(
29192 _version: MavlinkVersion,
29193 __input: &[u8],
29194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29195 let avail_len = __input.len();
29196 let mut payload_buf = [0; Self::ENCODED_LEN];
29197 let mut buf = if avail_len < Self::ENCODED_LEN {
29198 payload_buf[0..avail_len].copy_from_slice(__input);
29199 Bytes::new(&payload_buf)
29200 } else {
29201 Bytes::new(__input)
29202 };
29203 let mut __struct = Self::default();
29204 __struct.capacity_full_specification = buf.get_i32_le();
29205 __struct.capacity_full = buf.get_i32_le();
29206 __struct.cycle_count = buf.get_u16_le();
29207 __struct.weight = buf.get_u16_le();
29208 __struct.discharge_minimum_voltage = buf.get_u16_le();
29209 __struct.charging_minimum_voltage = buf.get_u16_le();
29210 __struct.resting_minimum_voltage = buf.get_u16_le();
29211 __struct.id = buf.get_u8();
29212 let tmp = buf.get_u8();
29213 __struct.battery_function =
29214 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29215 enum_type: "MavBatteryFunction",
29216 value: tmp as u32,
29217 })?;
29218 let tmp = buf.get_u8();
29219 __struct.mavtype =
29220 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29221 enum_type: "MavBatteryType",
29222 value: tmp as u32,
29223 })?;
29224 for v in &mut __struct.serial_number {
29225 let val = buf.get_u8();
29226 *v = val;
29227 }
29228 for v in &mut __struct.device_name {
29229 let val = buf.get_u8();
29230 *v = val;
29231 }
29232 __struct.charging_maximum_voltage = buf.get_u16_le();
29233 __struct.cells_in_series = buf.get_u8();
29234 __struct.discharge_maximum_current = buf.get_u32_le();
29235 __struct.discharge_maximum_burst_current = buf.get_u32_le();
29236 for v in &mut __struct.manufacture_date {
29237 let val = buf.get_u8();
29238 *v = val;
29239 }
29240 Ok(__struct)
29241 }
29242 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29243 let mut __tmp = BytesMut::new(bytes);
29244 #[allow(clippy::absurd_extreme_comparisons)]
29245 #[allow(unused_comparisons)]
29246 if __tmp.remaining() < Self::ENCODED_LEN {
29247 panic!(
29248 "buffer is too small (need {} bytes, but got {})",
29249 Self::ENCODED_LEN,
29250 __tmp.remaining(),
29251 )
29252 }
29253 __tmp.put_i32_le(self.capacity_full_specification);
29254 __tmp.put_i32_le(self.capacity_full);
29255 __tmp.put_u16_le(self.cycle_count);
29256 __tmp.put_u16_le(self.weight);
29257 __tmp.put_u16_le(self.discharge_minimum_voltage);
29258 __tmp.put_u16_le(self.charging_minimum_voltage);
29259 __tmp.put_u16_le(self.resting_minimum_voltage);
29260 __tmp.put_u8(self.id);
29261 __tmp.put_u8(self.battery_function as u8);
29262 __tmp.put_u8(self.mavtype as u8);
29263 for val in &self.serial_number {
29264 __tmp.put_u8(*val);
29265 }
29266 for val in &self.device_name {
29267 __tmp.put_u8(*val);
29268 }
29269 if matches!(version, MavlinkVersion::V2) {
29270 __tmp.put_u16_le(self.charging_maximum_voltage);
29271 __tmp.put_u8(self.cells_in_series);
29272 __tmp.put_u32_le(self.discharge_maximum_current);
29273 __tmp.put_u32_le(self.discharge_maximum_burst_current);
29274 for val in &self.manufacture_date {
29275 __tmp.put_u8(*val);
29276 }
29277 let len = __tmp.len();
29278 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29279 } else {
29280 __tmp.len()
29281 }
29282 }
29283}
29284#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
29285#[doc = ""]
29286#[doc = "ID: 253"]
29287#[derive(Debug, Clone, PartialEq)]
29288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29290#[cfg_attr(feature = "ts", derive(TS))]
29291#[cfg_attr(feature = "ts", ts(export))]
29292pub struct STATUSTEXT_DATA {
29293 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
29294 pub severity: MavSeverity,
29295 #[doc = "Status text message, without null termination character"]
29296 #[cfg_attr(
29297 feature = "serde",
29298 serde(
29299 serialize_with = "crate::nulstr::serialize::<_, 50>",
29300 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
29301 )
29302 )]
29303 #[cfg_attr(feature = "ts", ts(type = "string"))]
29304 pub text: [u8; 50],
29305 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
29306 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29307 pub id: u16,
29308 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
29309 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29310 pub chunk_seq: u8,
29311}
29312impl STATUSTEXT_DATA {
29313 pub const ENCODED_LEN: usize = 54usize;
29314 pub const DEFAULT: Self = Self {
29315 severity: MavSeverity::DEFAULT,
29316 text: [0_u8; 50usize],
29317 id: 0_u16,
29318 chunk_seq: 0_u8,
29319 };
29320 #[cfg(feature = "arbitrary")]
29321 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29322 use arbitrary::{Arbitrary, Unstructured};
29323 let mut buf = [0u8; 1024];
29324 rng.fill_bytes(&mut buf);
29325 let mut unstructured = Unstructured::new(&buf);
29326 Self::arbitrary(&mut unstructured).unwrap_or_default()
29327 }
29328}
29329impl Default for STATUSTEXT_DATA {
29330 fn default() -> Self {
29331 Self::DEFAULT.clone()
29332 }
29333}
29334impl MessageData for STATUSTEXT_DATA {
29335 type Message = MavMessage;
29336 const ID: u32 = 253u32;
29337 const NAME: &'static str = "STATUSTEXT";
29338 const EXTRA_CRC: u8 = 83u8;
29339 const ENCODED_LEN: usize = 54usize;
29340 fn deser(
29341 _version: MavlinkVersion,
29342 __input: &[u8],
29343 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29344 let avail_len = __input.len();
29345 let mut payload_buf = [0; Self::ENCODED_LEN];
29346 let mut buf = if avail_len < Self::ENCODED_LEN {
29347 payload_buf[0..avail_len].copy_from_slice(__input);
29348 Bytes::new(&payload_buf)
29349 } else {
29350 Bytes::new(__input)
29351 };
29352 let mut __struct = Self::default();
29353 let tmp = buf.get_u8();
29354 __struct.severity =
29355 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29356 enum_type: "MavSeverity",
29357 value: tmp as u32,
29358 })?;
29359 for v in &mut __struct.text {
29360 let val = buf.get_u8();
29361 *v = val;
29362 }
29363 __struct.id = buf.get_u16_le();
29364 __struct.chunk_seq = buf.get_u8();
29365 Ok(__struct)
29366 }
29367 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29368 let mut __tmp = BytesMut::new(bytes);
29369 #[allow(clippy::absurd_extreme_comparisons)]
29370 #[allow(unused_comparisons)]
29371 if __tmp.remaining() < Self::ENCODED_LEN {
29372 panic!(
29373 "buffer is too small (need {} bytes, but got {})",
29374 Self::ENCODED_LEN,
29375 __tmp.remaining(),
29376 )
29377 }
29378 __tmp.put_u8(self.severity as u8);
29379 for val in &self.text {
29380 __tmp.put_u8(*val);
29381 }
29382 if matches!(version, MavlinkVersion::V2) {
29383 __tmp.put_u16_le(self.id);
29384 __tmp.put_u8(self.chunk_seq);
29385 let len = __tmp.len();
29386 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29387 } else {
29388 __tmp.len()
29389 }
29390 }
29391}
29392#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
29393#[doc = ""]
29394#[doc = "ID: 261"]
29395#[derive(Debug, Clone, PartialEq)]
29396#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29397#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29398#[cfg_attr(feature = "ts", derive(TS))]
29399#[cfg_attr(feature = "ts", ts(export))]
29400pub struct STORAGE_INFORMATION_DATA {
29401 #[doc = "Timestamp (time since system boot)."]
29402 pub time_boot_ms: u32,
29403 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29404 pub total_capacity: f32,
29405 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29406 pub used_capacity: f32,
29407 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29408 pub available_capacity: f32,
29409 #[doc = "Read speed."]
29410 pub read_speed: f32,
29411 #[doc = "Write speed."]
29412 pub write_speed: f32,
29413 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
29414 pub storage_id: u8,
29415 #[doc = "Number of storage devices"]
29416 pub storage_count: u8,
29417 #[doc = "Status of storage"]
29418 pub status: StorageStatus,
29419 #[doc = "Type of storage"]
29420 #[cfg_attr(feature = "serde", serde(default))]
29421 pub mavtype: StorageType,
29422 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
29423 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29424 #[cfg_attr(
29425 feature = "serde",
29426 serde(
29427 serialize_with = "crate::nulstr::serialize::<_, 32>",
29428 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
29429 )
29430 )]
29431 #[cfg_attr(feature = "ts", ts(type = "string"))]
29432 pub name: [u8; 32],
29433 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
29434 #[cfg_attr(feature = "serde", serde(default))]
29435 pub storage_usage: StorageUsageFlag,
29436}
29437impl STORAGE_INFORMATION_DATA {
29438 pub const ENCODED_LEN: usize = 61usize;
29439 pub const DEFAULT: Self = Self {
29440 time_boot_ms: 0_u32,
29441 total_capacity: 0.0_f32,
29442 used_capacity: 0.0_f32,
29443 available_capacity: 0.0_f32,
29444 read_speed: 0.0_f32,
29445 write_speed: 0.0_f32,
29446 storage_id: 0_u8,
29447 storage_count: 0_u8,
29448 status: StorageStatus::DEFAULT,
29449 mavtype: StorageType::DEFAULT,
29450 name: [0_u8; 32usize],
29451 storage_usage: StorageUsageFlag::DEFAULT,
29452 };
29453 #[cfg(feature = "arbitrary")]
29454 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29455 use arbitrary::{Arbitrary, Unstructured};
29456 let mut buf = [0u8; 1024];
29457 rng.fill_bytes(&mut buf);
29458 let mut unstructured = Unstructured::new(&buf);
29459 Self::arbitrary(&mut unstructured).unwrap_or_default()
29460 }
29461}
29462impl Default for STORAGE_INFORMATION_DATA {
29463 fn default() -> Self {
29464 Self::DEFAULT.clone()
29465 }
29466}
29467impl MessageData for STORAGE_INFORMATION_DATA {
29468 type Message = MavMessage;
29469 const ID: u32 = 261u32;
29470 const NAME: &'static str = "STORAGE_INFORMATION";
29471 const EXTRA_CRC: u8 = 179u8;
29472 const ENCODED_LEN: usize = 61usize;
29473 fn deser(
29474 _version: MavlinkVersion,
29475 __input: &[u8],
29476 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29477 let avail_len = __input.len();
29478 let mut payload_buf = [0; Self::ENCODED_LEN];
29479 let mut buf = if avail_len < Self::ENCODED_LEN {
29480 payload_buf[0..avail_len].copy_from_slice(__input);
29481 Bytes::new(&payload_buf)
29482 } else {
29483 Bytes::new(__input)
29484 };
29485 let mut __struct = Self::default();
29486 __struct.time_boot_ms = buf.get_u32_le();
29487 __struct.total_capacity = buf.get_f32_le();
29488 __struct.used_capacity = buf.get_f32_le();
29489 __struct.available_capacity = buf.get_f32_le();
29490 __struct.read_speed = buf.get_f32_le();
29491 __struct.write_speed = buf.get_f32_le();
29492 __struct.storage_id = buf.get_u8();
29493 __struct.storage_count = buf.get_u8();
29494 let tmp = buf.get_u8();
29495 __struct.status =
29496 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29497 enum_type: "StorageStatus",
29498 value: tmp as u32,
29499 })?;
29500 let tmp = buf.get_u8();
29501 __struct.mavtype =
29502 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29503 enum_type: "StorageType",
29504 value: tmp as u32,
29505 })?;
29506 for v in &mut __struct.name {
29507 let val = buf.get_u8();
29508 *v = val;
29509 }
29510 let tmp = buf.get_u8();
29511 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
29512 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29513 flag_type: "StorageUsageFlag",
29514 value: tmp as u32,
29515 })?;
29516 Ok(__struct)
29517 }
29518 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29519 let mut __tmp = BytesMut::new(bytes);
29520 #[allow(clippy::absurd_extreme_comparisons)]
29521 #[allow(unused_comparisons)]
29522 if __tmp.remaining() < Self::ENCODED_LEN {
29523 panic!(
29524 "buffer is too small (need {} bytes, but got {})",
29525 Self::ENCODED_LEN,
29526 __tmp.remaining(),
29527 )
29528 }
29529 __tmp.put_u32_le(self.time_boot_ms);
29530 __tmp.put_f32_le(self.total_capacity);
29531 __tmp.put_f32_le(self.used_capacity);
29532 __tmp.put_f32_le(self.available_capacity);
29533 __tmp.put_f32_le(self.read_speed);
29534 __tmp.put_f32_le(self.write_speed);
29535 __tmp.put_u8(self.storage_id);
29536 __tmp.put_u8(self.storage_count);
29537 __tmp.put_u8(self.status as u8);
29538 if matches!(version, MavlinkVersion::V2) {
29539 __tmp.put_u8(self.mavtype as u8);
29540 for val in &self.name {
29541 __tmp.put_u8(*val);
29542 }
29543 __tmp.put_u8(self.storage_usage.bits());
29544 let len = __tmp.len();
29545 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29546 } else {
29547 __tmp.len()
29548 }
29549 }
29550}
29551#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
29552#[doc = ""]
29553#[doc = "ID: 401"]
29554#[derive(Debug, Clone, PartialEq)]
29555#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29556#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29557#[cfg_attr(feature = "ts", derive(TS))]
29558#[cfg_attr(feature = "ts", ts(export))]
29559pub struct SUPPORTED_TUNES_DATA {
29560 #[doc = "Bitfield of supported tune formats."]
29561 pub format: TuneFormat,
29562 #[doc = "System ID"]
29563 pub target_system: u8,
29564 #[doc = "Component ID"]
29565 pub target_component: u8,
29566}
29567impl SUPPORTED_TUNES_DATA {
29568 pub const ENCODED_LEN: usize = 6usize;
29569 pub const DEFAULT: Self = Self {
29570 format: TuneFormat::DEFAULT,
29571 target_system: 0_u8,
29572 target_component: 0_u8,
29573 };
29574 #[cfg(feature = "arbitrary")]
29575 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29576 use arbitrary::{Arbitrary, Unstructured};
29577 let mut buf = [0u8; 1024];
29578 rng.fill_bytes(&mut buf);
29579 let mut unstructured = Unstructured::new(&buf);
29580 Self::arbitrary(&mut unstructured).unwrap_or_default()
29581 }
29582}
29583impl Default for SUPPORTED_TUNES_DATA {
29584 fn default() -> Self {
29585 Self::DEFAULT.clone()
29586 }
29587}
29588impl MessageData for SUPPORTED_TUNES_DATA {
29589 type Message = MavMessage;
29590 const ID: u32 = 401u32;
29591 const NAME: &'static str = "SUPPORTED_TUNES";
29592 const EXTRA_CRC: u8 = 183u8;
29593 const ENCODED_LEN: usize = 6usize;
29594 fn deser(
29595 _version: MavlinkVersion,
29596 __input: &[u8],
29597 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29598 let avail_len = __input.len();
29599 let mut payload_buf = [0; Self::ENCODED_LEN];
29600 let mut buf = if avail_len < Self::ENCODED_LEN {
29601 payload_buf[0..avail_len].copy_from_slice(__input);
29602 Bytes::new(&payload_buf)
29603 } else {
29604 Bytes::new(__input)
29605 };
29606 let mut __struct = Self::default();
29607 let tmp = buf.get_u32_le();
29608 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
29609 ::mavlink_core::error::ParserError::InvalidEnum {
29610 enum_type: "TuneFormat",
29611 value: tmp as u32,
29612 },
29613 )?;
29614 __struct.target_system = buf.get_u8();
29615 __struct.target_component = buf.get_u8();
29616 Ok(__struct)
29617 }
29618 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29619 let mut __tmp = BytesMut::new(bytes);
29620 #[allow(clippy::absurd_extreme_comparisons)]
29621 #[allow(unused_comparisons)]
29622 if __tmp.remaining() < Self::ENCODED_LEN {
29623 panic!(
29624 "buffer is too small (need {} bytes, but got {})",
29625 Self::ENCODED_LEN,
29626 __tmp.remaining(),
29627 )
29628 }
29629 __tmp.put_u32_le(self.format as u32);
29630 __tmp.put_u8(self.target_system);
29631 __tmp.put_u8(self.target_component);
29632 if matches!(version, MavlinkVersion::V2) {
29633 let len = __tmp.len();
29634 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29635 } else {
29636 __tmp.len()
29637 }
29638 }
29639}
29640#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29641#[doc = ""]
29642#[doc = "ID: 2"]
29643#[derive(Debug, Clone, PartialEq)]
29644#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29645#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29646#[cfg_attr(feature = "ts", derive(TS))]
29647#[cfg_attr(feature = "ts", ts(export))]
29648pub struct SYSTEM_TIME_DATA {
29649 #[doc = "Timestamp (UNIX epoch time)."]
29650 pub time_unix_usec: u64,
29651 #[doc = "Timestamp (time since system boot)."]
29652 pub time_boot_ms: u32,
29653}
29654impl SYSTEM_TIME_DATA {
29655 pub const ENCODED_LEN: usize = 12usize;
29656 pub const DEFAULT: Self = Self {
29657 time_unix_usec: 0_u64,
29658 time_boot_ms: 0_u32,
29659 };
29660 #[cfg(feature = "arbitrary")]
29661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29662 use arbitrary::{Arbitrary, Unstructured};
29663 let mut buf = [0u8; 1024];
29664 rng.fill_bytes(&mut buf);
29665 let mut unstructured = Unstructured::new(&buf);
29666 Self::arbitrary(&mut unstructured).unwrap_or_default()
29667 }
29668}
29669impl Default for SYSTEM_TIME_DATA {
29670 fn default() -> Self {
29671 Self::DEFAULT.clone()
29672 }
29673}
29674impl MessageData for SYSTEM_TIME_DATA {
29675 type Message = MavMessage;
29676 const ID: u32 = 2u32;
29677 const NAME: &'static str = "SYSTEM_TIME";
29678 const EXTRA_CRC: u8 = 137u8;
29679 const ENCODED_LEN: usize = 12usize;
29680 fn deser(
29681 _version: MavlinkVersion,
29682 __input: &[u8],
29683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29684 let avail_len = __input.len();
29685 let mut payload_buf = [0; Self::ENCODED_LEN];
29686 let mut buf = if avail_len < Self::ENCODED_LEN {
29687 payload_buf[0..avail_len].copy_from_slice(__input);
29688 Bytes::new(&payload_buf)
29689 } else {
29690 Bytes::new(__input)
29691 };
29692 let mut __struct = Self::default();
29693 __struct.time_unix_usec = buf.get_u64_le();
29694 __struct.time_boot_ms = buf.get_u32_le();
29695 Ok(__struct)
29696 }
29697 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29698 let mut __tmp = BytesMut::new(bytes);
29699 #[allow(clippy::absurd_extreme_comparisons)]
29700 #[allow(unused_comparisons)]
29701 if __tmp.remaining() < Self::ENCODED_LEN {
29702 panic!(
29703 "buffer is too small (need {} bytes, but got {})",
29704 Self::ENCODED_LEN,
29705 __tmp.remaining(),
29706 )
29707 }
29708 __tmp.put_u64_le(self.time_unix_usec);
29709 __tmp.put_u32_le(self.time_boot_ms);
29710 if matches!(version, MavlinkVersion::V2) {
29711 let len = __tmp.len();
29712 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29713 } else {
29714 __tmp.len()
29715 }
29716 }
29717}
29718#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
29719#[doc = ""]
29720#[doc = "ID: 1"]
29721#[derive(Debug, Clone, PartialEq)]
29722#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29723#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29724#[cfg_attr(feature = "ts", derive(TS))]
29725#[cfg_attr(feature = "ts", ts(export))]
29726pub struct SYS_STATUS_DATA {
29727 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29728 pub onboard_control_sensors_present: MavSysStatusSensor,
29729 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29730 pub onboard_control_sensors_enabled: MavSysStatusSensor,
29731 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29732 pub onboard_control_sensors_health: MavSysStatusSensor,
29733 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
29734 pub load: u16,
29735 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
29736 pub voltage_battery: u16,
29737 #[doc = "Battery current, -1: Current not sent by autopilot"]
29738 pub current_battery: i16,
29739 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29740 pub drop_rate_comm: u16,
29741 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29742 pub errors_comm: u16,
29743 #[doc = "Autopilot-specific errors"]
29744 pub errors_count1: u16,
29745 #[doc = "Autopilot-specific errors"]
29746 pub errors_count2: u16,
29747 #[doc = "Autopilot-specific errors"]
29748 pub errors_count3: u16,
29749 #[doc = "Autopilot-specific errors"]
29750 pub errors_count4: u16,
29751 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
29752 pub battery_remaining: i8,
29753 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29754 #[cfg_attr(feature = "serde", serde(default))]
29755 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
29756 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29757 #[cfg_attr(feature = "serde", serde(default))]
29758 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
29759 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29760 #[cfg_attr(feature = "serde", serde(default))]
29761 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
29762}
29763impl SYS_STATUS_DATA {
29764 pub const ENCODED_LEN: usize = 43usize;
29765 pub const DEFAULT: Self = Self {
29766 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
29767 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
29768 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
29769 load: 0_u16,
29770 voltage_battery: 0_u16,
29771 current_battery: 0_i16,
29772 drop_rate_comm: 0_u16,
29773 errors_comm: 0_u16,
29774 errors_count1: 0_u16,
29775 errors_count2: 0_u16,
29776 errors_count3: 0_u16,
29777 errors_count4: 0_u16,
29778 battery_remaining: 0_i8,
29779 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
29780 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
29781 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
29782 };
29783 #[cfg(feature = "arbitrary")]
29784 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29785 use arbitrary::{Arbitrary, Unstructured};
29786 let mut buf = [0u8; 1024];
29787 rng.fill_bytes(&mut buf);
29788 let mut unstructured = Unstructured::new(&buf);
29789 Self::arbitrary(&mut unstructured).unwrap_or_default()
29790 }
29791}
29792impl Default for SYS_STATUS_DATA {
29793 fn default() -> Self {
29794 Self::DEFAULT.clone()
29795 }
29796}
29797impl MessageData for SYS_STATUS_DATA {
29798 type Message = MavMessage;
29799 const ID: u32 = 1u32;
29800 const NAME: &'static str = "SYS_STATUS";
29801 const EXTRA_CRC: u8 = 124u8;
29802 const ENCODED_LEN: usize = 43usize;
29803 fn deser(
29804 _version: MavlinkVersion,
29805 __input: &[u8],
29806 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29807 let avail_len = __input.len();
29808 let mut payload_buf = [0; Self::ENCODED_LEN];
29809 let mut buf = if avail_len < Self::ENCODED_LEN {
29810 payload_buf[0..avail_len].copy_from_slice(__input);
29811 Bytes::new(&payload_buf)
29812 } else {
29813 Bytes::new(__input)
29814 };
29815 let mut __struct = Self::default();
29816 let tmp = buf.get_u32_le();
29817 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
29818 tmp & MavSysStatusSensor::all().bits(),
29819 )
29820 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29821 flag_type: "MavSysStatusSensor",
29822 value: tmp as u32,
29823 })?;
29824 let tmp = buf.get_u32_le();
29825 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
29826 tmp & MavSysStatusSensor::all().bits(),
29827 )
29828 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29829 flag_type: "MavSysStatusSensor",
29830 value: tmp as u32,
29831 })?;
29832 let tmp = buf.get_u32_le();
29833 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
29834 tmp & MavSysStatusSensor::all().bits(),
29835 )
29836 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29837 flag_type: "MavSysStatusSensor",
29838 value: tmp as u32,
29839 })?;
29840 __struct.load = buf.get_u16_le();
29841 __struct.voltage_battery = buf.get_u16_le();
29842 __struct.current_battery = buf.get_i16_le();
29843 __struct.drop_rate_comm = buf.get_u16_le();
29844 __struct.errors_comm = buf.get_u16_le();
29845 __struct.errors_count1 = buf.get_u16_le();
29846 __struct.errors_count2 = buf.get_u16_le();
29847 __struct.errors_count3 = buf.get_u16_le();
29848 __struct.errors_count4 = buf.get_u16_le();
29849 __struct.battery_remaining = buf.get_i8();
29850 let tmp = buf.get_u32_le();
29851 __struct.onboard_control_sensors_present_extended =
29852 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29853 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29854 flag_type: "MavSysStatusSensorExtended",
29855 value: tmp as u32,
29856 })?;
29857 let tmp = buf.get_u32_le();
29858 __struct.onboard_control_sensors_enabled_extended =
29859 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29860 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29861 flag_type: "MavSysStatusSensorExtended",
29862 value: tmp as u32,
29863 })?;
29864 let tmp = buf.get_u32_le();
29865 __struct.onboard_control_sensors_health_extended =
29866 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29867 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29868 flag_type: "MavSysStatusSensorExtended",
29869 value: tmp as u32,
29870 })?;
29871 Ok(__struct)
29872 }
29873 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29874 let mut __tmp = BytesMut::new(bytes);
29875 #[allow(clippy::absurd_extreme_comparisons)]
29876 #[allow(unused_comparisons)]
29877 if __tmp.remaining() < Self::ENCODED_LEN {
29878 panic!(
29879 "buffer is too small (need {} bytes, but got {})",
29880 Self::ENCODED_LEN,
29881 __tmp.remaining(),
29882 )
29883 }
29884 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
29885 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
29886 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
29887 __tmp.put_u16_le(self.load);
29888 __tmp.put_u16_le(self.voltage_battery);
29889 __tmp.put_i16_le(self.current_battery);
29890 __tmp.put_u16_le(self.drop_rate_comm);
29891 __tmp.put_u16_le(self.errors_comm);
29892 __tmp.put_u16_le(self.errors_count1);
29893 __tmp.put_u16_le(self.errors_count2);
29894 __tmp.put_u16_le(self.errors_count3);
29895 __tmp.put_u16_le(self.errors_count4);
29896 __tmp.put_i8(self.battery_remaining);
29897 if matches!(version, MavlinkVersion::V2) {
29898 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
29899 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
29900 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
29901 let len = __tmp.len();
29902 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29903 } else {
29904 __tmp.len()
29905 }
29906 }
29907}
29908#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
29909#[doc = ""]
29910#[doc = "ID: 135"]
29911#[derive(Debug, Clone, PartialEq)]
29912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29914#[cfg_attr(feature = "ts", derive(TS))]
29915#[cfg_attr(feature = "ts", ts(export))]
29916pub struct TERRAIN_CHECK_DATA {
29917 #[doc = "Latitude"]
29918 pub lat: i32,
29919 #[doc = "Longitude"]
29920 pub lon: i32,
29921}
29922impl TERRAIN_CHECK_DATA {
29923 pub const ENCODED_LEN: usize = 8usize;
29924 pub const DEFAULT: Self = Self {
29925 lat: 0_i32,
29926 lon: 0_i32,
29927 };
29928 #[cfg(feature = "arbitrary")]
29929 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29930 use arbitrary::{Arbitrary, Unstructured};
29931 let mut buf = [0u8; 1024];
29932 rng.fill_bytes(&mut buf);
29933 let mut unstructured = Unstructured::new(&buf);
29934 Self::arbitrary(&mut unstructured).unwrap_or_default()
29935 }
29936}
29937impl Default for TERRAIN_CHECK_DATA {
29938 fn default() -> Self {
29939 Self::DEFAULT.clone()
29940 }
29941}
29942impl MessageData for TERRAIN_CHECK_DATA {
29943 type Message = MavMessage;
29944 const ID: u32 = 135u32;
29945 const NAME: &'static str = "TERRAIN_CHECK";
29946 const EXTRA_CRC: u8 = 203u8;
29947 const ENCODED_LEN: usize = 8usize;
29948 fn deser(
29949 _version: MavlinkVersion,
29950 __input: &[u8],
29951 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29952 let avail_len = __input.len();
29953 let mut payload_buf = [0; Self::ENCODED_LEN];
29954 let mut buf = if avail_len < Self::ENCODED_LEN {
29955 payload_buf[0..avail_len].copy_from_slice(__input);
29956 Bytes::new(&payload_buf)
29957 } else {
29958 Bytes::new(__input)
29959 };
29960 let mut __struct = Self::default();
29961 __struct.lat = buf.get_i32_le();
29962 __struct.lon = buf.get_i32_le();
29963 Ok(__struct)
29964 }
29965 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29966 let mut __tmp = BytesMut::new(bytes);
29967 #[allow(clippy::absurd_extreme_comparisons)]
29968 #[allow(unused_comparisons)]
29969 if __tmp.remaining() < Self::ENCODED_LEN {
29970 panic!(
29971 "buffer is too small (need {} bytes, but got {})",
29972 Self::ENCODED_LEN,
29973 __tmp.remaining(),
29974 )
29975 }
29976 __tmp.put_i32_le(self.lat);
29977 __tmp.put_i32_le(self.lon);
29978 if matches!(version, MavlinkVersion::V2) {
29979 let len = __tmp.len();
29980 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29981 } else {
29982 __tmp.len()
29983 }
29984 }
29985}
29986#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29987#[doc = ""]
29988#[doc = "ID: 134"]
29989#[derive(Debug, Clone, PartialEq)]
29990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29991#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29992#[cfg_attr(feature = "ts", derive(TS))]
29993#[cfg_attr(feature = "ts", ts(export))]
29994pub struct TERRAIN_DATA_DATA {
29995 #[doc = "Latitude of SW corner of first grid"]
29996 pub lat: i32,
29997 #[doc = "Longitude of SW corner of first grid"]
29998 pub lon: i32,
29999 #[doc = "Grid spacing"]
30000 pub grid_spacing: u16,
30001 #[doc = "Terrain data MSL"]
30002 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30003 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30004 pub data: [i16; 16],
30005 #[doc = "bit within the terrain request mask"]
30006 pub gridbit: u8,
30007}
30008impl TERRAIN_DATA_DATA {
30009 pub const ENCODED_LEN: usize = 43usize;
30010 pub const DEFAULT: Self = Self {
30011 lat: 0_i32,
30012 lon: 0_i32,
30013 grid_spacing: 0_u16,
30014 data: [0_i16; 16usize],
30015 gridbit: 0_u8,
30016 };
30017 #[cfg(feature = "arbitrary")]
30018 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30019 use arbitrary::{Arbitrary, Unstructured};
30020 let mut buf = [0u8; 1024];
30021 rng.fill_bytes(&mut buf);
30022 let mut unstructured = Unstructured::new(&buf);
30023 Self::arbitrary(&mut unstructured).unwrap_or_default()
30024 }
30025}
30026impl Default for TERRAIN_DATA_DATA {
30027 fn default() -> Self {
30028 Self::DEFAULT.clone()
30029 }
30030}
30031impl MessageData for TERRAIN_DATA_DATA {
30032 type Message = MavMessage;
30033 const ID: u32 = 134u32;
30034 const NAME: &'static str = "TERRAIN_DATA";
30035 const EXTRA_CRC: u8 = 229u8;
30036 const ENCODED_LEN: usize = 43usize;
30037 fn deser(
30038 _version: MavlinkVersion,
30039 __input: &[u8],
30040 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30041 let avail_len = __input.len();
30042 let mut payload_buf = [0; Self::ENCODED_LEN];
30043 let mut buf = if avail_len < Self::ENCODED_LEN {
30044 payload_buf[0..avail_len].copy_from_slice(__input);
30045 Bytes::new(&payload_buf)
30046 } else {
30047 Bytes::new(__input)
30048 };
30049 let mut __struct = Self::default();
30050 __struct.lat = buf.get_i32_le();
30051 __struct.lon = buf.get_i32_le();
30052 __struct.grid_spacing = buf.get_u16_le();
30053 for v in &mut __struct.data {
30054 let val = buf.get_i16_le();
30055 *v = val;
30056 }
30057 __struct.gridbit = buf.get_u8();
30058 Ok(__struct)
30059 }
30060 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30061 let mut __tmp = BytesMut::new(bytes);
30062 #[allow(clippy::absurd_extreme_comparisons)]
30063 #[allow(unused_comparisons)]
30064 if __tmp.remaining() < Self::ENCODED_LEN {
30065 panic!(
30066 "buffer is too small (need {} bytes, but got {})",
30067 Self::ENCODED_LEN,
30068 __tmp.remaining(),
30069 )
30070 }
30071 __tmp.put_i32_le(self.lat);
30072 __tmp.put_i32_le(self.lon);
30073 __tmp.put_u16_le(self.grid_spacing);
30074 for val in &self.data {
30075 __tmp.put_i16_le(*val);
30076 }
30077 __tmp.put_u8(self.gridbit);
30078 if matches!(version, MavlinkVersion::V2) {
30079 let len = __tmp.len();
30080 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30081 } else {
30082 __tmp.len()
30083 }
30084 }
30085}
30086#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30087#[doc = ""]
30088#[doc = "ID: 136"]
30089#[derive(Debug, Clone, PartialEq)]
30090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30091#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30092#[cfg_attr(feature = "ts", derive(TS))]
30093#[cfg_attr(feature = "ts", ts(export))]
30094pub struct TERRAIN_REPORT_DATA {
30095 #[doc = "Latitude"]
30096 pub lat: i32,
30097 #[doc = "Longitude"]
30098 pub lon: i32,
30099 #[doc = "Terrain height MSL"]
30100 pub terrain_height: f32,
30101 #[doc = "Current vehicle height above lat/lon terrain height"]
30102 pub current_height: f32,
30103 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
30104 pub spacing: u16,
30105 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
30106 pub pending: u16,
30107 #[doc = "Number of 4x4 terrain blocks in memory"]
30108 pub loaded: u16,
30109}
30110impl TERRAIN_REPORT_DATA {
30111 pub const ENCODED_LEN: usize = 22usize;
30112 pub const DEFAULT: Self = Self {
30113 lat: 0_i32,
30114 lon: 0_i32,
30115 terrain_height: 0.0_f32,
30116 current_height: 0.0_f32,
30117 spacing: 0_u16,
30118 pending: 0_u16,
30119 loaded: 0_u16,
30120 };
30121 #[cfg(feature = "arbitrary")]
30122 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30123 use arbitrary::{Arbitrary, Unstructured};
30124 let mut buf = [0u8; 1024];
30125 rng.fill_bytes(&mut buf);
30126 let mut unstructured = Unstructured::new(&buf);
30127 Self::arbitrary(&mut unstructured).unwrap_or_default()
30128 }
30129}
30130impl Default for TERRAIN_REPORT_DATA {
30131 fn default() -> Self {
30132 Self::DEFAULT.clone()
30133 }
30134}
30135impl MessageData for TERRAIN_REPORT_DATA {
30136 type Message = MavMessage;
30137 const ID: u32 = 136u32;
30138 const NAME: &'static str = "TERRAIN_REPORT";
30139 const EXTRA_CRC: u8 = 1u8;
30140 const ENCODED_LEN: usize = 22usize;
30141 fn deser(
30142 _version: MavlinkVersion,
30143 __input: &[u8],
30144 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30145 let avail_len = __input.len();
30146 let mut payload_buf = [0; Self::ENCODED_LEN];
30147 let mut buf = if avail_len < Self::ENCODED_LEN {
30148 payload_buf[0..avail_len].copy_from_slice(__input);
30149 Bytes::new(&payload_buf)
30150 } else {
30151 Bytes::new(__input)
30152 };
30153 let mut __struct = Self::default();
30154 __struct.lat = buf.get_i32_le();
30155 __struct.lon = buf.get_i32_le();
30156 __struct.terrain_height = buf.get_f32_le();
30157 __struct.current_height = buf.get_f32_le();
30158 __struct.spacing = buf.get_u16_le();
30159 __struct.pending = buf.get_u16_le();
30160 __struct.loaded = buf.get_u16_le();
30161 Ok(__struct)
30162 }
30163 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30164 let mut __tmp = BytesMut::new(bytes);
30165 #[allow(clippy::absurd_extreme_comparisons)]
30166 #[allow(unused_comparisons)]
30167 if __tmp.remaining() < Self::ENCODED_LEN {
30168 panic!(
30169 "buffer is too small (need {} bytes, but got {})",
30170 Self::ENCODED_LEN,
30171 __tmp.remaining(),
30172 )
30173 }
30174 __tmp.put_i32_le(self.lat);
30175 __tmp.put_i32_le(self.lon);
30176 __tmp.put_f32_le(self.terrain_height);
30177 __tmp.put_f32_le(self.current_height);
30178 __tmp.put_u16_le(self.spacing);
30179 __tmp.put_u16_le(self.pending);
30180 __tmp.put_u16_le(self.loaded);
30181 if matches!(version, MavlinkVersion::V2) {
30182 let len = __tmp.len();
30183 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30184 } else {
30185 __tmp.len()
30186 }
30187 }
30188}
30189#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30190#[doc = ""]
30191#[doc = "ID: 133"]
30192#[derive(Debug, Clone, PartialEq)]
30193#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30194#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30195#[cfg_attr(feature = "ts", derive(TS))]
30196#[cfg_attr(feature = "ts", ts(export))]
30197pub struct TERRAIN_REQUEST_DATA {
30198 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
30199 pub mask: u64,
30200 #[doc = "Latitude of SW corner of first grid"]
30201 pub lat: i32,
30202 #[doc = "Longitude of SW corner of first grid"]
30203 pub lon: i32,
30204 #[doc = "Grid spacing"]
30205 pub grid_spacing: u16,
30206}
30207impl TERRAIN_REQUEST_DATA {
30208 pub const ENCODED_LEN: usize = 18usize;
30209 pub const DEFAULT: Self = Self {
30210 mask: 0_u64,
30211 lat: 0_i32,
30212 lon: 0_i32,
30213 grid_spacing: 0_u16,
30214 };
30215 #[cfg(feature = "arbitrary")]
30216 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30217 use arbitrary::{Arbitrary, Unstructured};
30218 let mut buf = [0u8; 1024];
30219 rng.fill_bytes(&mut buf);
30220 let mut unstructured = Unstructured::new(&buf);
30221 Self::arbitrary(&mut unstructured).unwrap_or_default()
30222 }
30223}
30224impl Default for TERRAIN_REQUEST_DATA {
30225 fn default() -> Self {
30226 Self::DEFAULT.clone()
30227 }
30228}
30229impl MessageData for TERRAIN_REQUEST_DATA {
30230 type Message = MavMessage;
30231 const ID: u32 = 133u32;
30232 const NAME: &'static str = "TERRAIN_REQUEST";
30233 const EXTRA_CRC: u8 = 6u8;
30234 const ENCODED_LEN: usize = 18usize;
30235 fn deser(
30236 _version: MavlinkVersion,
30237 __input: &[u8],
30238 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30239 let avail_len = __input.len();
30240 let mut payload_buf = [0; Self::ENCODED_LEN];
30241 let mut buf = if avail_len < Self::ENCODED_LEN {
30242 payload_buf[0..avail_len].copy_from_slice(__input);
30243 Bytes::new(&payload_buf)
30244 } else {
30245 Bytes::new(__input)
30246 };
30247 let mut __struct = Self::default();
30248 __struct.mask = buf.get_u64_le();
30249 __struct.lat = buf.get_i32_le();
30250 __struct.lon = buf.get_i32_le();
30251 __struct.grid_spacing = buf.get_u16_le();
30252 Ok(__struct)
30253 }
30254 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30255 let mut __tmp = BytesMut::new(bytes);
30256 #[allow(clippy::absurd_extreme_comparisons)]
30257 #[allow(unused_comparisons)]
30258 if __tmp.remaining() < Self::ENCODED_LEN {
30259 panic!(
30260 "buffer is too small (need {} bytes, but got {})",
30261 Self::ENCODED_LEN,
30262 __tmp.remaining(),
30263 )
30264 }
30265 __tmp.put_u64_le(self.mask);
30266 __tmp.put_i32_le(self.lat);
30267 __tmp.put_i32_le(self.lon);
30268 __tmp.put_u16_le(self.grid_spacing);
30269 if matches!(version, MavlinkVersion::V2) {
30270 let len = __tmp.len();
30271 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30272 } else {
30273 __tmp.len()
30274 }
30275 }
30276}
30277#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
30278#[doc = ""]
30279#[doc = "ID: 111"]
30280#[derive(Debug, Clone, PartialEq)]
30281#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30282#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30283#[cfg_attr(feature = "ts", derive(TS))]
30284#[cfg_attr(feature = "ts", ts(export))]
30285pub struct TIMESYNC_DATA {
30286 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
30287 pub tc1: i64,
30288 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
30289 pub ts1: i64,
30290 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
30291 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30292 pub target_system: u8,
30293 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
30294 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30295 pub target_component: u8,
30296}
30297impl TIMESYNC_DATA {
30298 pub const ENCODED_LEN: usize = 18usize;
30299 pub const DEFAULT: Self = Self {
30300 tc1: 0_i64,
30301 ts1: 0_i64,
30302 target_system: 0_u8,
30303 target_component: 0_u8,
30304 };
30305 #[cfg(feature = "arbitrary")]
30306 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30307 use arbitrary::{Arbitrary, Unstructured};
30308 let mut buf = [0u8; 1024];
30309 rng.fill_bytes(&mut buf);
30310 let mut unstructured = Unstructured::new(&buf);
30311 Self::arbitrary(&mut unstructured).unwrap_or_default()
30312 }
30313}
30314impl Default for TIMESYNC_DATA {
30315 fn default() -> Self {
30316 Self::DEFAULT.clone()
30317 }
30318}
30319impl MessageData for TIMESYNC_DATA {
30320 type Message = MavMessage;
30321 const ID: u32 = 111u32;
30322 const NAME: &'static str = "TIMESYNC";
30323 const EXTRA_CRC: u8 = 34u8;
30324 const ENCODED_LEN: usize = 18usize;
30325 fn deser(
30326 _version: MavlinkVersion,
30327 __input: &[u8],
30328 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30329 let avail_len = __input.len();
30330 let mut payload_buf = [0; Self::ENCODED_LEN];
30331 let mut buf = if avail_len < Self::ENCODED_LEN {
30332 payload_buf[0..avail_len].copy_from_slice(__input);
30333 Bytes::new(&payload_buf)
30334 } else {
30335 Bytes::new(__input)
30336 };
30337 let mut __struct = Self::default();
30338 __struct.tc1 = buf.get_i64_le();
30339 __struct.ts1 = buf.get_i64_le();
30340 __struct.target_system = buf.get_u8();
30341 __struct.target_component = buf.get_u8();
30342 Ok(__struct)
30343 }
30344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30345 let mut __tmp = BytesMut::new(bytes);
30346 #[allow(clippy::absurd_extreme_comparisons)]
30347 #[allow(unused_comparisons)]
30348 if __tmp.remaining() < Self::ENCODED_LEN {
30349 panic!(
30350 "buffer is too small (need {} bytes, but got {})",
30351 Self::ENCODED_LEN,
30352 __tmp.remaining(),
30353 )
30354 }
30355 __tmp.put_i64_le(self.tc1);
30356 __tmp.put_i64_le(self.ts1);
30357 if matches!(version, MavlinkVersion::V2) {
30358 __tmp.put_u8(self.target_system);
30359 __tmp.put_u8(self.target_component);
30360 let len = __tmp.len();
30361 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30362 } else {
30363 __tmp.len()
30364 }
30365 }
30366}
30367#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
30368#[doc = ""]
30369#[doc = "ID: 380"]
30370#[derive(Debug, Clone, PartialEq)]
30371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30372#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30373#[cfg_attr(feature = "ts", derive(TS))]
30374#[cfg_attr(feature = "ts", ts(export))]
30375pub struct TIME_ESTIMATE_TO_TARGET_DATA {
30376 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
30377 pub safe_return: i32,
30378 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
30379 pub land: i32,
30380 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
30381 pub mission_next_item: i32,
30382 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
30383 pub mission_end: i32,
30384 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
30385 pub commanded_action: i32,
30386}
30387impl TIME_ESTIMATE_TO_TARGET_DATA {
30388 pub const ENCODED_LEN: usize = 20usize;
30389 pub const DEFAULT: Self = Self {
30390 safe_return: 0_i32,
30391 land: 0_i32,
30392 mission_next_item: 0_i32,
30393 mission_end: 0_i32,
30394 commanded_action: 0_i32,
30395 };
30396 #[cfg(feature = "arbitrary")]
30397 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30398 use arbitrary::{Arbitrary, Unstructured};
30399 let mut buf = [0u8; 1024];
30400 rng.fill_bytes(&mut buf);
30401 let mut unstructured = Unstructured::new(&buf);
30402 Self::arbitrary(&mut unstructured).unwrap_or_default()
30403 }
30404}
30405impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
30406 fn default() -> Self {
30407 Self::DEFAULT.clone()
30408 }
30409}
30410impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
30411 type Message = MavMessage;
30412 const ID: u32 = 380u32;
30413 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
30414 const EXTRA_CRC: u8 = 232u8;
30415 const ENCODED_LEN: usize = 20usize;
30416 fn deser(
30417 _version: MavlinkVersion,
30418 __input: &[u8],
30419 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30420 let avail_len = __input.len();
30421 let mut payload_buf = [0; Self::ENCODED_LEN];
30422 let mut buf = if avail_len < Self::ENCODED_LEN {
30423 payload_buf[0..avail_len].copy_from_slice(__input);
30424 Bytes::new(&payload_buf)
30425 } else {
30426 Bytes::new(__input)
30427 };
30428 let mut __struct = Self::default();
30429 __struct.safe_return = buf.get_i32_le();
30430 __struct.land = buf.get_i32_le();
30431 __struct.mission_next_item = buf.get_i32_le();
30432 __struct.mission_end = buf.get_i32_le();
30433 __struct.commanded_action = buf.get_i32_le();
30434 Ok(__struct)
30435 }
30436 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30437 let mut __tmp = BytesMut::new(bytes);
30438 #[allow(clippy::absurd_extreme_comparisons)]
30439 #[allow(unused_comparisons)]
30440 if __tmp.remaining() < Self::ENCODED_LEN {
30441 panic!(
30442 "buffer is too small (need {} bytes, but got {})",
30443 Self::ENCODED_LEN,
30444 __tmp.remaining(),
30445 )
30446 }
30447 __tmp.put_i32_le(self.safe_return);
30448 __tmp.put_i32_le(self.land);
30449 __tmp.put_i32_le(self.mission_next_item);
30450 __tmp.put_i32_le(self.mission_end);
30451 __tmp.put_i32_le(self.commanded_action);
30452 if matches!(version, MavlinkVersion::V2) {
30453 let len = __tmp.len();
30454 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30455 } else {
30456 __tmp.len()
30457 }
30458 }
30459}
30460#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
30461#[doc = ""]
30462#[doc = "ID: 333"]
30463#[derive(Debug, Clone, PartialEq)]
30464#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30465#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30466#[cfg_attr(feature = "ts", derive(TS))]
30467#[cfg_attr(feature = "ts", ts(export))]
30468pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30469 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30470 pub time_usec: u64,
30471 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
30472 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30473 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30474 pub pos_x: [f32; 5],
30475 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
30476 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30477 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30478 pub pos_y: [f32; 5],
30479 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
30480 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30481 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30482 pub pos_z: [f32; 5],
30483 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
30484 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30485 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30486 pub delta: [f32; 5],
30487 #[doc = "Yaw. Set to NaN for unchanged"]
30488 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30489 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30490 pub pos_yaw: [f32; 5],
30491 #[doc = "Number of valid control points (up-to 5 points are possible)"]
30492 pub valid_points: u8,
30493}
30494impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30495 pub const ENCODED_LEN: usize = 109usize;
30496 pub const DEFAULT: Self = Self {
30497 time_usec: 0_u64,
30498 pos_x: [0.0_f32; 5usize],
30499 pos_y: [0.0_f32; 5usize],
30500 pos_z: [0.0_f32; 5usize],
30501 delta: [0.0_f32; 5usize],
30502 pos_yaw: [0.0_f32; 5usize],
30503 valid_points: 0_u8,
30504 };
30505 #[cfg(feature = "arbitrary")]
30506 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30507 use arbitrary::{Arbitrary, Unstructured};
30508 let mut buf = [0u8; 1024];
30509 rng.fill_bytes(&mut buf);
30510 let mut unstructured = Unstructured::new(&buf);
30511 Self::arbitrary(&mut unstructured).unwrap_or_default()
30512 }
30513}
30514impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30515 fn default() -> Self {
30516 Self::DEFAULT.clone()
30517 }
30518}
30519impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30520 type Message = MavMessage;
30521 const ID: u32 = 333u32;
30522 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
30523 const EXTRA_CRC: u8 = 231u8;
30524 const ENCODED_LEN: usize = 109usize;
30525 fn deser(
30526 _version: MavlinkVersion,
30527 __input: &[u8],
30528 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30529 let avail_len = __input.len();
30530 let mut payload_buf = [0; Self::ENCODED_LEN];
30531 let mut buf = if avail_len < Self::ENCODED_LEN {
30532 payload_buf[0..avail_len].copy_from_slice(__input);
30533 Bytes::new(&payload_buf)
30534 } else {
30535 Bytes::new(__input)
30536 };
30537 let mut __struct = Self::default();
30538 __struct.time_usec = buf.get_u64_le();
30539 for v in &mut __struct.pos_x {
30540 let val = buf.get_f32_le();
30541 *v = val;
30542 }
30543 for v in &mut __struct.pos_y {
30544 let val = buf.get_f32_le();
30545 *v = val;
30546 }
30547 for v in &mut __struct.pos_z {
30548 let val = buf.get_f32_le();
30549 *v = val;
30550 }
30551 for v in &mut __struct.delta {
30552 let val = buf.get_f32_le();
30553 *v = val;
30554 }
30555 for v in &mut __struct.pos_yaw {
30556 let val = buf.get_f32_le();
30557 *v = val;
30558 }
30559 __struct.valid_points = buf.get_u8();
30560 Ok(__struct)
30561 }
30562 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30563 let mut __tmp = BytesMut::new(bytes);
30564 #[allow(clippy::absurd_extreme_comparisons)]
30565 #[allow(unused_comparisons)]
30566 if __tmp.remaining() < Self::ENCODED_LEN {
30567 panic!(
30568 "buffer is too small (need {} bytes, but got {})",
30569 Self::ENCODED_LEN,
30570 __tmp.remaining(),
30571 )
30572 }
30573 __tmp.put_u64_le(self.time_usec);
30574 for val in &self.pos_x {
30575 __tmp.put_f32_le(*val);
30576 }
30577 for val in &self.pos_y {
30578 __tmp.put_f32_le(*val);
30579 }
30580 for val in &self.pos_z {
30581 __tmp.put_f32_le(*val);
30582 }
30583 for val in &self.delta {
30584 __tmp.put_f32_le(*val);
30585 }
30586 for val in &self.pos_yaw {
30587 __tmp.put_f32_le(*val);
30588 }
30589 __tmp.put_u8(self.valid_points);
30590 if matches!(version, MavlinkVersion::V2) {
30591 let len = __tmp.len();
30592 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30593 } else {
30594 __tmp.len()
30595 }
30596 }
30597}
30598#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
30599#[doc = ""]
30600#[doc = "ID: 332"]
30601#[derive(Debug, Clone, PartialEq)]
30602#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30604#[cfg_attr(feature = "ts", derive(TS))]
30605#[cfg_attr(feature = "ts", ts(export))]
30606pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30607 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30608 pub time_usec: u64,
30609 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
30610 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30611 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30612 pub pos_x: [f32; 5],
30613 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
30614 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30615 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30616 pub pos_y: [f32; 5],
30617 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
30618 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30619 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30620 pub pos_z: [f32; 5],
30621 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
30622 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30623 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30624 pub vel_x: [f32; 5],
30625 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30626 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30627 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30628 pub vel_y: [f32; 5],
30629 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30630 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30631 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30632 pub vel_z: [f32; 5],
30633 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30634 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30635 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30636 pub acc_x: [f32; 5],
30637 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30638 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30639 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30640 pub acc_y: [f32; 5],
30641 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30642 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30643 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30644 pub acc_z: [f32; 5],
30645 #[doc = "Yaw angle, set to NaN if not being used"]
30646 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30647 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30648 pub pos_yaw: [f32; 5],
30649 #[doc = "Yaw rate, set to NaN if not being used"]
30650 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30651 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30652 pub vel_yaw: [f32; 5],
30653 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30654 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30655 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30656 pub command: [u16; 5],
30657 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30658 pub valid_points: u8,
30659}
30660impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30661 pub const ENCODED_LEN: usize = 239usize;
30662 pub const DEFAULT: Self = Self {
30663 time_usec: 0_u64,
30664 pos_x: [0.0_f32; 5usize],
30665 pos_y: [0.0_f32; 5usize],
30666 pos_z: [0.0_f32; 5usize],
30667 vel_x: [0.0_f32; 5usize],
30668 vel_y: [0.0_f32; 5usize],
30669 vel_z: [0.0_f32; 5usize],
30670 acc_x: [0.0_f32; 5usize],
30671 acc_y: [0.0_f32; 5usize],
30672 acc_z: [0.0_f32; 5usize],
30673 pos_yaw: [0.0_f32; 5usize],
30674 vel_yaw: [0.0_f32; 5usize],
30675 command: [0_u16; 5usize],
30676 valid_points: 0_u8,
30677 };
30678 #[cfg(feature = "arbitrary")]
30679 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30680 use arbitrary::{Arbitrary, Unstructured};
30681 let mut buf = [0u8; 1024];
30682 rng.fill_bytes(&mut buf);
30683 let mut unstructured = Unstructured::new(&buf);
30684 Self::arbitrary(&mut unstructured).unwrap_or_default()
30685 }
30686}
30687impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30688 fn default() -> Self {
30689 Self::DEFAULT.clone()
30690 }
30691}
30692impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30693 type Message = MavMessage;
30694 const ID: u32 = 332u32;
30695 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30696 const EXTRA_CRC: u8 = 236u8;
30697 const ENCODED_LEN: usize = 239usize;
30698 fn deser(
30699 _version: MavlinkVersion,
30700 __input: &[u8],
30701 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30702 let avail_len = __input.len();
30703 let mut payload_buf = [0; Self::ENCODED_LEN];
30704 let mut buf = if avail_len < Self::ENCODED_LEN {
30705 payload_buf[0..avail_len].copy_from_slice(__input);
30706 Bytes::new(&payload_buf)
30707 } else {
30708 Bytes::new(__input)
30709 };
30710 let mut __struct = Self::default();
30711 __struct.time_usec = buf.get_u64_le();
30712 for v in &mut __struct.pos_x {
30713 let val = buf.get_f32_le();
30714 *v = val;
30715 }
30716 for v in &mut __struct.pos_y {
30717 let val = buf.get_f32_le();
30718 *v = val;
30719 }
30720 for v in &mut __struct.pos_z {
30721 let val = buf.get_f32_le();
30722 *v = val;
30723 }
30724 for v in &mut __struct.vel_x {
30725 let val = buf.get_f32_le();
30726 *v = val;
30727 }
30728 for v in &mut __struct.vel_y {
30729 let val = buf.get_f32_le();
30730 *v = val;
30731 }
30732 for v in &mut __struct.vel_z {
30733 let val = buf.get_f32_le();
30734 *v = val;
30735 }
30736 for v in &mut __struct.acc_x {
30737 let val = buf.get_f32_le();
30738 *v = val;
30739 }
30740 for v in &mut __struct.acc_y {
30741 let val = buf.get_f32_le();
30742 *v = val;
30743 }
30744 for v in &mut __struct.acc_z {
30745 let val = buf.get_f32_le();
30746 *v = val;
30747 }
30748 for v in &mut __struct.pos_yaw {
30749 let val = buf.get_f32_le();
30750 *v = val;
30751 }
30752 for v in &mut __struct.vel_yaw {
30753 let val = buf.get_f32_le();
30754 *v = val;
30755 }
30756 for v in &mut __struct.command {
30757 let val = buf.get_u16_le();
30758 *v = val;
30759 }
30760 __struct.valid_points = buf.get_u8();
30761 Ok(__struct)
30762 }
30763 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30764 let mut __tmp = BytesMut::new(bytes);
30765 #[allow(clippy::absurd_extreme_comparisons)]
30766 #[allow(unused_comparisons)]
30767 if __tmp.remaining() < Self::ENCODED_LEN {
30768 panic!(
30769 "buffer is too small (need {} bytes, but got {})",
30770 Self::ENCODED_LEN,
30771 __tmp.remaining(),
30772 )
30773 }
30774 __tmp.put_u64_le(self.time_usec);
30775 for val in &self.pos_x {
30776 __tmp.put_f32_le(*val);
30777 }
30778 for val in &self.pos_y {
30779 __tmp.put_f32_le(*val);
30780 }
30781 for val in &self.pos_z {
30782 __tmp.put_f32_le(*val);
30783 }
30784 for val in &self.vel_x {
30785 __tmp.put_f32_le(*val);
30786 }
30787 for val in &self.vel_y {
30788 __tmp.put_f32_le(*val);
30789 }
30790 for val in &self.vel_z {
30791 __tmp.put_f32_le(*val);
30792 }
30793 for val in &self.acc_x {
30794 __tmp.put_f32_le(*val);
30795 }
30796 for val in &self.acc_y {
30797 __tmp.put_f32_le(*val);
30798 }
30799 for val in &self.acc_z {
30800 __tmp.put_f32_le(*val);
30801 }
30802 for val in &self.pos_yaw {
30803 __tmp.put_f32_le(*val);
30804 }
30805 for val in &self.vel_yaw {
30806 __tmp.put_f32_le(*val);
30807 }
30808 for val in &self.command {
30809 __tmp.put_u16_le(*val);
30810 }
30811 __tmp.put_u8(self.valid_points);
30812 if matches!(version, MavlinkVersion::V2) {
30813 let len = __tmp.len();
30814 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30815 } else {
30816 __tmp.len()
30817 }
30818 }
30819}
30820#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
30821#[doc = ""]
30822#[doc = "ID: 385"]
30823#[derive(Debug, Clone, PartialEq)]
30824#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30825#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30826#[cfg_attr(feature = "ts", derive(TS))]
30827#[cfg_attr(feature = "ts", ts(export))]
30828pub struct TUNNEL_DATA {
30829 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30830 pub payload_type: MavTunnelPayloadType,
30831 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
30832 pub target_system: u8,
30833 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
30834 pub target_component: u8,
30835 #[doc = "Length of the data transported in payload"]
30836 pub payload_length: u8,
30837 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
30838 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30839 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30840 pub payload: [u8; 128],
30841}
30842impl TUNNEL_DATA {
30843 pub const ENCODED_LEN: usize = 133usize;
30844 pub const DEFAULT: Self = Self {
30845 payload_type: MavTunnelPayloadType::DEFAULT,
30846 target_system: 0_u8,
30847 target_component: 0_u8,
30848 payload_length: 0_u8,
30849 payload: [0_u8; 128usize],
30850 };
30851 #[cfg(feature = "arbitrary")]
30852 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30853 use arbitrary::{Arbitrary, Unstructured};
30854 let mut buf = [0u8; 1024];
30855 rng.fill_bytes(&mut buf);
30856 let mut unstructured = Unstructured::new(&buf);
30857 Self::arbitrary(&mut unstructured).unwrap_or_default()
30858 }
30859}
30860impl Default for TUNNEL_DATA {
30861 fn default() -> Self {
30862 Self::DEFAULT.clone()
30863 }
30864}
30865impl MessageData for TUNNEL_DATA {
30866 type Message = MavMessage;
30867 const ID: u32 = 385u32;
30868 const NAME: &'static str = "TUNNEL";
30869 const EXTRA_CRC: u8 = 147u8;
30870 const ENCODED_LEN: usize = 133usize;
30871 fn deser(
30872 _version: MavlinkVersion,
30873 __input: &[u8],
30874 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30875 let avail_len = __input.len();
30876 let mut payload_buf = [0; Self::ENCODED_LEN];
30877 let mut buf = if avail_len < Self::ENCODED_LEN {
30878 payload_buf[0..avail_len].copy_from_slice(__input);
30879 Bytes::new(&payload_buf)
30880 } else {
30881 Bytes::new(__input)
30882 };
30883 let mut __struct = Self::default();
30884 let tmp = buf.get_u16_le();
30885 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
30886 ::mavlink_core::error::ParserError::InvalidEnum {
30887 enum_type: "MavTunnelPayloadType",
30888 value: tmp as u32,
30889 },
30890 )?;
30891 __struct.target_system = buf.get_u8();
30892 __struct.target_component = buf.get_u8();
30893 __struct.payload_length = buf.get_u8();
30894 for v in &mut __struct.payload {
30895 let val = buf.get_u8();
30896 *v = val;
30897 }
30898 Ok(__struct)
30899 }
30900 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30901 let mut __tmp = BytesMut::new(bytes);
30902 #[allow(clippy::absurd_extreme_comparisons)]
30903 #[allow(unused_comparisons)]
30904 if __tmp.remaining() < Self::ENCODED_LEN {
30905 panic!(
30906 "buffer is too small (need {} bytes, but got {})",
30907 Self::ENCODED_LEN,
30908 __tmp.remaining(),
30909 )
30910 }
30911 __tmp.put_u16_le(self.payload_type as u16);
30912 __tmp.put_u8(self.target_system);
30913 __tmp.put_u8(self.target_component);
30914 __tmp.put_u8(self.payload_length);
30915 for val in &self.payload {
30916 __tmp.put_u8(*val);
30917 }
30918 if matches!(version, MavlinkVersion::V2) {
30919 let len = __tmp.len();
30920 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30921 } else {
30922 __tmp.len()
30923 }
30924 }
30925}
30926#[doc = "System status specific to ualberta uav."]
30927#[doc = ""]
30928#[doc = "ID: 222"]
30929#[derive(Debug, Clone, PartialEq)]
30930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30932#[cfg_attr(feature = "ts", derive(TS))]
30933#[cfg_attr(feature = "ts", ts(export))]
30934pub struct UALBERTA_SYS_STATUS_DATA {
30935 #[doc = "System mode, see UALBERTA_AUTOPILOT_MODE ENUM"]
30936 pub mode: u8,
30937 #[doc = "Navigation mode, see UALBERTA_NAV_MODE ENUM"]
30938 pub nav_mode: u8,
30939 #[doc = "Pilot mode, see UALBERTA_PILOT_MODE"]
30940 pub pilot: u8,
30941}
30942impl UALBERTA_SYS_STATUS_DATA {
30943 pub const ENCODED_LEN: usize = 3usize;
30944 pub const DEFAULT: Self = Self {
30945 mode: 0_u8,
30946 nav_mode: 0_u8,
30947 pilot: 0_u8,
30948 };
30949 #[cfg(feature = "arbitrary")]
30950 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30951 use arbitrary::{Arbitrary, Unstructured};
30952 let mut buf = [0u8; 1024];
30953 rng.fill_bytes(&mut buf);
30954 let mut unstructured = Unstructured::new(&buf);
30955 Self::arbitrary(&mut unstructured).unwrap_or_default()
30956 }
30957}
30958impl Default for UALBERTA_SYS_STATUS_DATA {
30959 fn default() -> Self {
30960 Self::DEFAULT.clone()
30961 }
30962}
30963impl MessageData for UALBERTA_SYS_STATUS_DATA {
30964 type Message = MavMessage;
30965 const ID: u32 = 222u32;
30966 const NAME: &'static str = "UALBERTA_SYS_STATUS";
30967 const EXTRA_CRC: u8 = 15u8;
30968 const ENCODED_LEN: usize = 3usize;
30969 fn deser(
30970 _version: MavlinkVersion,
30971 __input: &[u8],
30972 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30973 let avail_len = __input.len();
30974 let mut payload_buf = [0; Self::ENCODED_LEN];
30975 let mut buf = if avail_len < Self::ENCODED_LEN {
30976 payload_buf[0..avail_len].copy_from_slice(__input);
30977 Bytes::new(&payload_buf)
30978 } else {
30979 Bytes::new(__input)
30980 };
30981 let mut __struct = Self::default();
30982 __struct.mode = buf.get_u8();
30983 __struct.nav_mode = buf.get_u8();
30984 __struct.pilot = buf.get_u8();
30985 Ok(__struct)
30986 }
30987 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30988 let mut __tmp = BytesMut::new(bytes);
30989 #[allow(clippy::absurd_extreme_comparisons)]
30990 #[allow(unused_comparisons)]
30991 if __tmp.remaining() < Self::ENCODED_LEN {
30992 panic!(
30993 "buffer is too small (need {} bytes, but got {})",
30994 Self::ENCODED_LEN,
30995 __tmp.remaining(),
30996 )
30997 }
30998 __tmp.put_u8(self.mode);
30999 __tmp.put_u8(self.nav_mode);
31000 __tmp.put_u8(self.pilot);
31001 if matches!(version, MavlinkVersion::V2) {
31002 let len = __tmp.len();
31003 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31004 } else {
31005 __tmp.len()
31006 }
31007 }
31008}
31009#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
31010#[doc = ""]
31011#[doc = "ID: 311"]
31012#[derive(Debug, Clone, PartialEq)]
31013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31015#[cfg_attr(feature = "ts", derive(TS))]
31016#[cfg_attr(feature = "ts", ts(export))]
31017pub struct UAVCAN_NODE_INFO_DATA {
31018 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31019 pub time_usec: u64,
31020 #[doc = "Time since the start-up of the node."]
31021 pub uptime_sec: u32,
31022 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
31023 pub sw_vcs_commit: u32,
31024 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
31025 #[cfg_attr(
31026 feature = "serde",
31027 serde(
31028 serialize_with = "crate::nulstr::serialize::<_, 80>",
31029 deserialize_with = "crate::nulstr::deserialize::<_, 80>"
31030 )
31031 )]
31032 #[cfg_attr(feature = "ts", ts(type = "string"))]
31033 pub name: [u8; 80],
31034 #[doc = "Hardware major version number."]
31035 pub hw_version_major: u8,
31036 #[doc = "Hardware minor version number."]
31037 pub hw_version_minor: u8,
31038 #[doc = "Hardware unique 128-bit ID."]
31039 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31040 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31041 pub hw_unique_id: [u8; 16],
31042 #[doc = "Software major version number."]
31043 pub sw_version_major: u8,
31044 #[doc = "Software minor version number."]
31045 pub sw_version_minor: u8,
31046}
31047impl UAVCAN_NODE_INFO_DATA {
31048 pub const ENCODED_LEN: usize = 116usize;
31049 pub const DEFAULT: Self = Self {
31050 time_usec: 0_u64,
31051 uptime_sec: 0_u32,
31052 sw_vcs_commit: 0_u32,
31053 name: [0_u8; 80usize],
31054 hw_version_major: 0_u8,
31055 hw_version_minor: 0_u8,
31056 hw_unique_id: [0_u8; 16usize],
31057 sw_version_major: 0_u8,
31058 sw_version_minor: 0_u8,
31059 };
31060 #[cfg(feature = "arbitrary")]
31061 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31062 use arbitrary::{Arbitrary, Unstructured};
31063 let mut buf = [0u8; 1024];
31064 rng.fill_bytes(&mut buf);
31065 let mut unstructured = Unstructured::new(&buf);
31066 Self::arbitrary(&mut unstructured).unwrap_or_default()
31067 }
31068}
31069impl Default for UAVCAN_NODE_INFO_DATA {
31070 fn default() -> Self {
31071 Self::DEFAULT.clone()
31072 }
31073}
31074impl MessageData for UAVCAN_NODE_INFO_DATA {
31075 type Message = MavMessage;
31076 const ID: u32 = 311u32;
31077 const NAME: &'static str = "UAVCAN_NODE_INFO";
31078 const EXTRA_CRC: u8 = 95u8;
31079 const ENCODED_LEN: usize = 116usize;
31080 fn deser(
31081 _version: MavlinkVersion,
31082 __input: &[u8],
31083 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31084 let avail_len = __input.len();
31085 let mut payload_buf = [0; Self::ENCODED_LEN];
31086 let mut buf = if avail_len < Self::ENCODED_LEN {
31087 payload_buf[0..avail_len].copy_from_slice(__input);
31088 Bytes::new(&payload_buf)
31089 } else {
31090 Bytes::new(__input)
31091 };
31092 let mut __struct = Self::default();
31093 __struct.time_usec = buf.get_u64_le();
31094 __struct.uptime_sec = buf.get_u32_le();
31095 __struct.sw_vcs_commit = buf.get_u32_le();
31096 for v in &mut __struct.name {
31097 let val = buf.get_u8();
31098 *v = val;
31099 }
31100 __struct.hw_version_major = buf.get_u8();
31101 __struct.hw_version_minor = buf.get_u8();
31102 for v in &mut __struct.hw_unique_id {
31103 let val = buf.get_u8();
31104 *v = val;
31105 }
31106 __struct.sw_version_major = buf.get_u8();
31107 __struct.sw_version_minor = buf.get_u8();
31108 Ok(__struct)
31109 }
31110 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31111 let mut __tmp = BytesMut::new(bytes);
31112 #[allow(clippy::absurd_extreme_comparisons)]
31113 #[allow(unused_comparisons)]
31114 if __tmp.remaining() < Self::ENCODED_LEN {
31115 panic!(
31116 "buffer is too small (need {} bytes, but got {})",
31117 Self::ENCODED_LEN,
31118 __tmp.remaining(),
31119 )
31120 }
31121 __tmp.put_u64_le(self.time_usec);
31122 __tmp.put_u32_le(self.uptime_sec);
31123 __tmp.put_u32_le(self.sw_vcs_commit);
31124 for val in &self.name {
31125 __tmp.put_u8(*val);
31126 }
31127 __tmp.put_u8(self.hw_version_major);
31128 __tmp.put_u8(self.hw_version_minor);
31129 for val in &self.hw_unique_id {
31130 __tmp.put_u8(*val);
31131 }
31132 __tmp.put_u8(self.sw_version_major);
31133 __tmp.put_u8(self.sw_version_minor);
31134 if matches!(version, MavlinkVersion::V2) {
31135 let len = __tmp.len();
31136 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31137 } else {
31138 __tmp.len()
31139 }
31140 }
31141}
31142#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
31143#[doc = ""]
31144#[doc = "ID: 310"]
31145#[derive(Debug, Clone, PartialEq)]
31146#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31147#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31148#[cfg_attr(feature = "ts", derive(TS))]
31149#[cfg_attr(feature = "ts", ts(export))]
31150pub struct UAVCAN_NODE_STATUS_DATA {
31151 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31152 pub time_usec: u64,
31153 #[doc = "Time since the start-up of the node."]
31154 pub uptime_sec: u32,
31155 #[doc = "Vendor-specific status information."]
31156 pub vendor_specific_status_code: u16,
31157 #[doc = "Generalized node health status."]
31158 pub health: UavcanNodeHealth,
31159 #[doc = "Generalized operating mode."]
31160 pub mode: UavcanNodeMode,
31161 #[doc = "Not used currently."]
31162 pub sub_mode: u8,
31163}
31164impl UAVCAN_NODE_STATUS_DATA {
31165 pub const ENCODED_LEN: usize = 17usize;
31166 pub const DEFAULT: Self = Self {
31167 time_usec: 0_u64,
31168 uptime_sec: 0_u32,
31169 vendor_specific_status_code: 0_u16,
31170 health: UavcanNodeHealth::DEFAULT,
31171 mode: UavcanNodeMode::DEFAULT,
31172 sub_mode: 0_u8,
31173 };
31174 #[cfg(feature = "arbitrary")]
31175 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31176 use arbitrary::{Arbitrary, Unstructured};
31177 let mut buf = [0u8; 1024];
31178 rng.fill_bytes(&mut buf);
31179 let mut unstructured = Unstructured::new(&buf);
31180 Self::arbitrary(&mut unstructured).unwrap_or_default()
31181 }
31182}
31183impl Default for UAVCAN_NODE_STATUS_DATA {
31184 fn default() -> Self {
31185 Self::DEFAULT.clone()
31186 }
31187}
31188impl MessageData for UAVCAN_NODE_STATUS_DATA {
31189 type Message = MavMessage;
31190 const ID: u32 = 310u32;
31191 const NAME: &'static str = "UAVCAN_NODE_STATUS";
31192 const EXTRA_CRC: u8 = 28u8;
31193 const ENCODED_LEN: usize = 17usize;
31194 fn deser(
31195 _version: MavlinkVersion,
31196 __input: &[u8],
31197 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31198 let avail_len = __input.len();
31199 let mut payload_buf = [0; Self::ENCODED_LEN];
31200 let mut buf = if avail_len < Self::ENCODED_LEN {
31201 payload_buf[0..avail_len].copy_from_slice(__input);
31202 Bytes::new(&payload_buf)
31203 } else {
31204 Bytes::new(__input)
31205 };
31206 let mut __struct = Self::default();
31207 __struct.time_usec = buf.get_u64_le();
31208 __struct.uptime_sec = buf.get_u32_le();
31209 __struct.vendor_specific_status_code = buf.get_u16_le();
31210 let tmp = buf.get_u8();
31211 __struct.health =
31212 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31213 enum_type: "UavcanNodeHealth",
31214 value: tmp as u32,
31215 })?;
31216 let tmp = buf.get_u8();
31217 __struct.mode =
31218 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31219 enum_type: "UavcanNodeMode",
31220 value: tmp as u32,
31221 })?;
31222 __struct.sub_mode = buf.get_u8();
31223 Ok(__struct)
31224 }
31225 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31226 let mut __tmp = BytesMut::new(bytes);
31227 #[allow(clippy::absurd_extreme_comparisons)]
31228 #[allow(unused_comparisons)]
31229 if __tmp.remaining() < Self::ENCODED_LEN {
31230 panic!(
31231 "buffer is too small (need {} bytes, but got {})",
31232 Self::ENCODED_LEN,
31233 __tmp.remaining(),
31234 )
31235 }
31236 __tmp.put_u64_le(self.time_usec);
31237 __tmp.put_u32_le(self.uptime_sec);
31238 __tmp.put_u16_le(self.vendor_specific_status_code);
31239 __tmp.put_u8(self.health as u8);
31240 __tmp.put_u8(self.mode as u8);
31241 __tmp.put_u8(self.sub_mode);
31242 if matches!(version, MavlinkVersion::V2) {
31243 let len = __tmp.len();
31244 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31245 } else {
31246 __tmp.len()
31247 }
31248 }
31249}
31250#[doc = "The global position resulting from GPS and sensor fusion."]
31251#[doc = ""]
31252#[doc = "ID: 340"]
31253#[derive(Debug, Clone, PartialEq)]
31254#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31256#[cfg_attr(feature = "ts", derive(TS))]
31257#[cfg_attr(feature = "ts", ts(export))]
31258pub struct UTM_GLOBAL_POSITION_DATA {
31259 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
31260 pub time: u64,
31261 #[doc = "Latitude (WGS84)"]
31262 pub lat: i32,
31263 #[doc = "Longitude (WGS84)"]
31264 pub lon: i32,
31265 #[doc = "Altitude (WGS84)"]
31266 pub alt: i32,
31267 #[doc = "Altitude above ground"]
31268 pub relative_alt: i32,
31269 #[doc = "Next waypoint, latitude (WGS84)"]
31270 pub next_lat: i32,
31271 #[doc = "Next waypoint, longitude (WGS84)"]
31272 pub next_lon: i32,
31273 #[doc = "Next waypoint, altitude (WGS84)"]
31274 pub next_alt: i32,
31275 #[doc = "Ground X speed (latitude, positive north)"]
31276 pub vx: i16,
31277 #[doc = "Ground Y speed (longitude, positive east)"]
31278 pub vy: i16,
31279 #[doc = "Ground Z speed (altitude, positive down)"]
31280 pub vz: i16,
31281 #[doc = "Horizontal position uncertainty (standard deviation)"]
31282 pub h_acc: u16,
31283 #[doc = "Altitude uncertainty (standard deviation)"]
31284 pub v_acc: u16,
31285 #[doc = "Speed uncertainty (standard deviation)"]
31286 pub vel_acc: u16,
31287 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
31288 pub update_rate: u16,
31289 #[doc = "Unique UAS ID."]
31290 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31291 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31292 pub uas_id: [u8; 18],
31293 #[doc = "Flight state"]
31294 pub flight_state: UtmFlightState,
31295 #[doc = "Bitwise OR combination of the data available flags."]
31296 pub flags: UtmDataAvailFlags,
31297}
31298impl UTM_GLOBAL_POSITION_DATA {
31299 pub const ENCODED_LEN: usize = 70usize;
31300 pub const DEFAULT: Self = Self {
31301 time: 0_u64,
31302 lat: 0_i32,
31303 lon: 0_i32,
31304 alt: 0_i32,
31305 relative_alt: 0_i32,
31306 next_lat: 0_i32,
31307 next_lon: 0_i32,
31308 next_alt: 0_i32,
31309 vx: 0_i16,
31310 vy: 0_i16,
31311 vz: 0_i16,
31312 h_acc: 0_u16,
31313 v_acc: 0_u16,
31314 vel_acc: 0_u16,
31315 update_rate: 0_u16,
31316 uas_id: [0_u8; 18usize],
31317 flight_state: UtmFlightState::DEFAULT,
31318 flags: UtmDataAvailFlags::DEFAULT,
31319 };
31320 #[cfg(feature = "arbitrary")]
31321 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31322 use arbitrary::{Arbitrary, Unstructured};
31323 let mut buf = [0u8; 1024];
31324 rng.fill_bytes(&mut buf);
31325 let mut unstructured = Unstructured::new(&buf);
31326 Self::arbitrary(&mut unstructured).unwrap_or_default()
31327 }
31328}
31329impl Default for UTM_GLOBAL_POSITION_DATA {
31330 fn default() -> Self {
31331 Self::DEFAULT.clone()
31332 }
31333}
31334impl MessageData for UTM_GLOBAL_POSITION_DATA {
31335 type Message = MavMessage;
31336 const ID: u32 = 340u32;
31337 const NAME: &'static str = "UTM_GLOBAL_POSITION";
31338 const EXTRA_CRC: u8 = 99u8;
31339 const ENCODED_LEN: usize = 70usize;
31340 fn deser(
31341 _version: MavlinkVersion,
31342 __input: &[u8],
31343 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31344 let avail_len = __input.len();
31345 let mut payload_buf = [0; Self::ENCODED_LEN];
31346 let mut buf = if avail_len < Self::ENCODED_LEN {
31347 payload_buf[0..avail_len].copy_from_slice(__input);
31348 Bytes::new(&payload_buf)
31349 } else {
31350 Bytes::new(__input)
31351 };
31352 let mut __struct = Self::default();
31353 __struct.time = buf.get_u64_le();
31354 __struct.lat = buf.get_i32_le();
31355 __struct.lon = buf.get_i32_le();
31356 __struct.alt = buf.get_i32_le();
31357 __struct.relative_alt = buf.get_i32_le();
31358 __struct.next_lat = buf.get_i32_le();
31359 __struct.next_lon = buf.get_i32_le();
31360 __struct.next_alt = buf.get_i32_le();
31361 __struct.vx = buf.get_i16_le();
31362 __struct.vy = buf.get_i16_le();
31363 __struct.vz = buf.get_i16_le();
31364 __struct.h_acc = buf.get_u16_le();
31365 __struct.v_acc = buf.get_u16_le();
31366 __struct.vel_acc = buf.get_u16_le();
31367 __struct.update_rate = buf.get_u16_le();
31368 for v in &mut __struct.uas_id {
31369 let val = buf.get_u8();
31370 *v = val;
31371 }
31372 let tmp = buf.get_u8();
31373 __struct.flight_state =
31374 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31375 enum_type: "UtmFlightState",
31376 value: tmp as u32,
31377 })?;
31378 let tmp = buf.get_u8();
31379 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
31380 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31381 flag_type: "UtmDataAvailFlags",
31382 value: tmp as u32,
31383 })?;
31384 Ok(__struct)
31385 }
31386 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31387 let mut __tmp = BytesMut::new(bytes);
31388 #[allow(clippy::absurd_extreme_comparisons)]
31389 #[allow(unused_comparisons)]
31390 if __tmp.remaining() < Self::ENCODED_LEN {
31391 panic!(
31392 "buffer is too small (need {} bytes, but got {})",
31393 Self::ENCODED_LEN,
31394 __tmp.remaining(),
31395 )
31396 }
31397 __tmp.put_u64_le(self.time);
31398 __tmp.put_i32_le(self.lat);
31399 __tmp.put_i32_le(self.lon);
31400 __tmp.put_i32_le(self.alt);
31401 __tmp.put_i32_le(self.relative_alt);
31402 __tmp.put_i32_le(self.next_lat);
31403 __tmp.put_i32_le(self.next_lon);
31404 __tmp.put_i32_le(self.next_alt);
31405 __tmp.put_i16_le(self.vx);
31406 __tmp.put_i16_le(self.vy);
31407 __tmp.put_i16_le(self.vz);
31408 __tmp.put_u16_le(self.h_acc);
31409 __tmp.put_u16_le(self.v_acc);
31410 __tmp.put_u16_le(self.vel_acc);
31411 __tmp.put_u16_le(self.update_rate);
31412 for val in &self.uas_id {
31413 __tmp.put_u8(*val);
31414 }
31415 __tmp.put_u8(self.flight_state as u8);
31416 __tmp.put_u8(self.flags.bits());
31417 if matches!(version, MavlinkVersion::V2) {
31418 let len = __tmp.len();
31419 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31420 } else {
31421 __tmp.len()
31422 }
31423 }
31424}
31425#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
31426#[doc = ""]
31427#[doc = "ID: 248"]
31428#[derive(Debug, Clone, PartialEq)]
31429#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31430#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31431#[cfg_attr(feature = "ts", derive(TS))]
31432#[cfg_attr(feature = "ts", ts(export))]
31433pub struct V2_EXTENSION_DATA {
31434 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31435 pub message_type: u16,
31436 #[doc = "Network ID (0 for broadcast)"]
31437 pub target_network: u8,
31438 #[doc = "System ID (0 for broadcast)"]
31439 pub target_system: u8,
31440 #[doc = "Component ID (0 for broadcast)"]
31441 pub target_component: u8,
31442 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
31443 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31444 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31445 pub payload: [u8; 249],
31446}
31447impl V2_EXTENSION_DATA {
31448 pub const ENCODED_LEN: usize = 254usize;
31449 pub const DEFAULT: Self = Self {
31450 message_type: 0_u16,
31451 target_network: 0_u8,
31452 target_system: 0_u8,
31453 target_component: 0_u8,
31454 payload: [0_u8; 249usize],
31455 };
31456 #[cfg(feature = "arbitrary")]
31457 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31458 use arbitrary::{Arbitrary, Unstructured};
31459 let mut buf = [0u8; 1024];
31460 rng.fill_bytes(&mut buf);
31461 let mut unstructured = Unstructured::new(&buf);
31462 Self::arbitrary(&mut unstructured).unwrap_or_default()
31463 }
31464}
31465impl Default for V2_EXTENSION_DATA {
31466 fn default() -> Self {
31467 Self::DEFAULT.clone()
31468 }
31469}
31470impl MessageData for V2_EXTENSION_DATA {
31471 type Message = MavMessage;
31472 const ID: u32 = 248u32;
31473 const NAME: &'static str = "V2_EXTENSION";
31474 const EXTRA_CRC: u8 = 8u8;
31475 const ENCODED_LEN: usize = 254usize;
31476 fn deser(
31477 _version: MavlinkVersion,
31478 __input: &[u8],
31479 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31480 let avail_len = __input.len();
31481 let mut payload_buf = [0; Self::ENCODED_LEN];
31482 let mut buf = if avail_len < Self::ENCODED_LEN {
31483 payload_buf[0..avail_len].copy_from_slice(__input);
31484 Bytes::new(&payload_buf)
31485 } else {
31486 Bytes::new(__input)
31487 };
31488 let mut __struct = Self::default();
31489 __struct.message_type = buf.get_u16_le();
31490 __struct.target_network = buf.get_u8();
31491 __struct.target_system = buf.get_u8();
31492 __struct.target_component = buf.get_u8();
31493 for v in &mut __struct.payload {
31494 let val = buf.get_u8();
31495 *v = val;
31496 }
31497 Ok(__struct)
31498 }
31499 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31500 let mut __tmp = BytesMut::new(bytes);
31501 #[allow(clippy::absurd_extreme_comparisons)]
31502 #[allow(unused_comparisons)]
31503 if __tmp.remaining() < Self::ENCODED_LEN {
31504 panic!(
31505 "buffer is too small (need {} bytes, but got {})",
31506 Self::ENCODED_LEN,
31507 __tmp.remaining(),
31508 )
31509 }
31510 __tmp.put_u16_le(self.message_type);
31511 __tmp.put_u8(self.target_network);
31512 __tmp.put_u8(self.target_system);
31513 __tmp.put_u8(self.target_component);
31514 for val in &self.payload {
31515 __tmp.put_u8(*val);
31516 }
31517 if matches!(version, MavlinkVersion::V2) {
31518 let len = __tmp.len();
31519 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31520 } else {
31521 __tmp.len()
31522 }
31523 }
31524}
31525#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
31526#[doc = ""]
31527#[doc = "ID: 74"]
31528#[derive(Debug, Clone, PartialEq)]
31529#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31530#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31531#[cfg_attr(feature = "ts", derive(TS))]
31532#[cfg_attr(feature = "ts", ts(export))]
31533pub struct VFR_HUD_DATA {
31534 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
31535 pub airspeed: f32,
31536 #[doc = "Current ground speed."]
31537 pub groundspeed: f32,
31538 #[doc = "Current altitude (MSL)."]
31539 pub alt: f32,
31540 #[doc = "Current climb rate."]
31541 pub climb: f32,
31542 #[doc = "Current heading in compass units (0-360, 0=north)."]
31543 pub heading: i16,
31544 #[doc = "Current throttle setting (0 to 100)."]
31545 pub throttle: u16,
31546}
31547impl VFR_HUD_DATA {
31548 pub const ENCODED_LEN: usize = 20usize;
31549 pub const DEFAULT: Self = Self {
31550 airspeed: 0.0_f32,
31551 groundspeed: 0.0_f32,
31552 alt: 0.0_f32,
31553 climb: 0.0_f32,
31554 heading: 0_i16,
31555 throttle: 0_u16,
31556 };
31557 #[cfg(feature = "arbitrary")]
31558 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31559 use arbitrary::{Arbitrary, Unstructured};
31560 let mut buf = [0u8; 1024];
31561 rng.fill_bytes(&mut buf);
31562 let mut unstructured = Unstructured::new(&buf);
31563 Self::arbitrary(&mut unstructured).unwrap_or_default()
31564 }
31565}
31566impl Default for VFR_HUD_DATA {
31567 fn default() -> Self {
31568 Self::DEFAULT.clone()
31569 }
31570}
31571impl MessageData for VFR_HUD_DATA {
31572 type Message = MavMessage;
31573 const ID: u32 = 74u32;
31574 const NAME: &'static str = "VFR_HUD";
31575 const EXTRA_CRC: u8 = 20u8;
31576 const ENCODED_LEN: usize = 20usize;
31577 fn deser(
31578 _version: MavlinkVersion,
31579 __input: &[u8],
31580 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31581 let avail_len = __input.len();
31582 let mut payload_buf = [0; Self::ENCODED_LEN];
31583 let mut buf = if avail_len < Self::ENCODED_LEN {
31584 payload_buf[0..avail_len].copy_from_slice(__input);
31585 Bytes::new(&payload_buf)
31586 } else {
31587 Bytes::new(__input)
31588 };
31589 let mut __struct = Self::default();
31590 __struct.airspeed = buf.get_f32_le();
31591 __struct.groundspeed = buf.get_f32_le();
31592 __struct.alt = buf.get_f32_le();
31593 __struct.climb = buf.get_f32_le();
31594 __struct.heading = buf.get_i16_le();
31595 __struct.throttle = buf.get_u16_le();
31596 Ok(__struct)
31597 }
31598 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31599 let mut __tmp = BytesMut::new(bytes);
31600 #[allow(clippy::absurd_extreme_comparisons)]
31601 #[allow(unused_comparisons)]
31602 if __tmp.remaining() < Self::ENCODED_LEN {
31603 panic!(
31604 "buffer is too small (need {} bytes, but got {})",
31605 Self::ENCODED_LEN,
31606 __tmp.remaining(),
31607 )
31608 }
31609 __tmp.put_f32_le(self.airspeed);
31610 __tmp.put_f32_le(self.groundspeed);
31611 __tmp.put_f32_le(self.alt);
31612 __tmp.put_f32_le(self.climb);
31613 __tmp.put_i16_le(self.heading);
31614 __tmp.put_u16_le(self.throttle);
31615 if matches!(version, MavlinkVersion::V2) {
31616 let len = __tmp.len();
31617 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31618 } else {
31619 __tmp.len()
31620 }
31621 }
31622}
31623#[doc = "Vibration levels and accelerometer clipping."]
31624#[doc = ""]
31625#[doc = "ID: 241"]
31626#[derive(Debug, Clone, PartialEq)]
31627#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31628#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31629#[cfg_attr(feature = "ts", derive(TS))]
31630#[cfg_attr(feature = "ts", ts(export))]
31631pub struct VIBRATION_DATA {
31632 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31633 pub time_usec: u64,
31634 #[doc = "Vibration levels on X-axis"]
31635 pub vibration_x: f32,
31636 #[doc = "Vibration levels on Y-axis"]
31637 pub vibration_y: f32,
31638 #[doc = "Vibration levels on Z-axis"]
31639 pub vibration_z: f32,
31640 #[doc = "first accelerometer clipping count"]
31641 pub clipping_0: u32,
31642 #[doc = "second accelerometer clipping count"]
31643 pub clipping_1: u32,
31644 #[doc = "third accelerometer clipping count"]
31645 pub clipping_2: u32,
31646}
31647impl VIBRATION_DATA {
31648 pub const ENCODED_LEN: usize = 32usize;
31649 pub const DEFAULT: Self = Self {
31650 time_usec: 0_u64,
31651 vibration_x: 0.0_f32,
31652 vibration_y: 0.0_f32,
31653 vibration_z: 0.0_f32,
31654 clipping_0: 0_u32,
31655 clipping_1: 0_u32,
31656 clipping_2: 0_u32,
31657 };
31658 #[cfg(feature = "arbitrary")]
31659 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31660 use arbitrary::{Arbitrary, Unstructured};
31661 let mut buf = [0u8; 1024];
31662 rng.fill_bytes(&mut buf);
31663 let mut unstructured = Unstructured::new(&buf);
31664 Self::arbitrary(&mut unstructured).unwrap_or_default()
31665 }
31666}
31667impl Default for VIBRATION_DATA {
31668 fn default() -> Self {
31669 Self::DEFAULT.clone()
31670 }
31671}
31672impl MessageData for VIBRATION_DATA {
31673 type Message = MavMessage;
31674 const ID: u32 = 241u32;
31675 const NAME: &'static str = "VIBRATION";
31676 const EXTRA_CRC: u8 = 90u8;
31677 const ENCODED_LEN: usize = 32usize;
31678 fn deser(
31679 _version: MavlinkVersion,
31680 __input: &[u8],
31681 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31682 let avail_len = __input.len();
31683 let mut payload_buf = [0; Self::ENCODED_LEN];
31684 let mut buf = if avail_len < Self::ENCODED_LEN {
31685 payload_buf[0..avail_len].copy_from_slice(__input);
31686 Bytes::new(&payload_buf)
31687 } else {
31688 Bytes::new(__input)
31689 };
31690 let mut __struct = Self::default();
31691 __struct.time_usec = buf.get_u64_le();
31692 __struct.vibration_x = buf.get_f32_le();
31693 __struct.vibration_y = buf.get_f32_le();
31694 __struct.vibration_z = buf.get_f32_le();
31695 __struct.clipping_0 = buf.get_u32_le();
31696 __struct.clipping_1 = buf.get_u32_le();
31697 __struct.clipping_2 = buf.get_u32_le();
31698 Ok(__struct)
31699 }
31700 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31701 let mut __tmp = BytesMut::new(bytes);
31702 #[allow(clippy::absurd_extreme_comparisons)]
31703 #[allow(unused_comparisons)]
31704 if __tmp.remaining() < Self::ENCODED_LEN {
31705 panic!(
31706 "buffer is too small (need {} bytes, but got {})",
31707 Self::ENCODED_LEN,
31708 __tmp.remaining(),
31709 )
31710 }
31711 __tmp.put_u64_le(self.time_usec);
31712 __tmp.put_f32_le(self.vibration_x);
31713 __tmp.put_f32_le(self.vibration_y);
31714 __tmp.put_f32_le(self.vibration_z);
31715 __tmp.put_u32_le(self.clipping_0);
31716 __tmp.put_u32_le(self.clipping_1);
31717 __tmp.put_u32_le(self.clipping_2);
31718 if matches!(version, MavlinkVersion::V2) {
31719 let len = __tmp.len();
31720 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31721 } else {
31722 __tmp.len()
31723 }
31724 }
31725}
31726#[doc = "Global position estimate from a Vicon motion system source."]
31727#[doc = ""]
31728#[doc = "ID: 104"]
31729#[derive(Debug, Clone, PartialEq)]
31730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31732#[cfg_attr(feature = "ts", derive(TS))]
31733#[cfg_attr(feature = "ts", ts(export))]
31734pub struct VICON_POSITION_ESTIMATE_DATA {
31735 #[doc = "Timestamp (UNIX time or time since system boot)"]
31736 pub usec: u64,
31737 #[doc = "Global X position"]
31738 pub x: f32,
31739 #[doc = "Global Y position"]
31740 pub y: f32,
31741 #[doc = "Global Z position"]
31742 pub z: f32,
31743 #[doc = "Roll angle"]
31744 pub roll: f32,
31745 #[doc = "Pitch angle"]
31746 pub pitch: f32,
31747 #[doc = "Yaw angle"]
31748 pub yaw: f32,
31749 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31750 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31751 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31752 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31753 pub covariance: [f32; 21],
31754}
31755impl VICON_POSITION_ESTIMATE_DATA {
31756 pub const ENCODED_LEN: usize = 116usize;
31757 pub const DEFAULT: Self = Self {
31758 usec: 0_u64,
31759 x: 0.0_f32,
31760 y: 0.0_f32,
31761 z: 0.0_f32,
31762 roll: 0.0_f32,
31763 pitch: 0.0_f32,
31764 yaw: 0.0_f32,
31765 covariance: [0.0_f32; 21usize],
31766 };
31767 #[cfg(feature = "arbitrary")]
31768 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31769 use arbitrary::{Arbitrary, Unstructured};
31770 let mut buf = [0u8; 1024];
31771 rng.fill_bytes(&mut buf);
31772 let mut unstructured = Unstructured::new(&buf);
31773 Self::arbitrary(&mut unstructured).unwrap_or_default()
31774 }
31775}
31776impl Default for VICON_POSITION_ESTIMATE_DATA {
31777 fn default() -> Self {
31778 Self::DEFAULT.clone()
31779 }
31780}
31781impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31782 type Message = MavMessage;
31783 const ID: u32 = 104u32;
31784 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31785 const EXTRA_CRC: u8 = 56u8;
31786 const ENCODED_LEN: usize = 116usize;
31787 fn deser(
31788 _version: MavlinkVersion,
31789 __input: &[u8],
31790 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31791 let avail_len = __input.len();
31792 let mut payload_buf = [0; Self::ENCODED_LEN];
31793 let mut buf = if avail_len < Self::ENCODED_LEN {
31794 payload_buf[0..avail_len].copy_from_slice(__input);
31795 Bytes::new(&payload_buf)
31796 } else {
31797 Bytes::new(__input)
31798 };
31799 let mut __struct = Self::default();
31800 __struct.usec = buf.get_u64_le();
31801 __struct.x = buf.get_f32_le();
31802 __struct.y = buf.get_f32_le();
31803 __struct.z = buf.get_f32_le();
31804 __struct.roll = buf.get_f32_le();
31805 __struct.pitch = buf.get_f32_le();
31806 __struct.yaw = buf.get_f32_le();
31807 for v in &mut __struct.covariance {
31808 let val = buf.get_f32_le();
31809 *v = val;
31810 }
31811 Ok(__struct)
31812 }
31813 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31814 let mut __tmp = BytesMut::new(bytes);
31815 #[allow(clippy::absurd_extreme_comparisons)]
31816 #[allow(unused_comparisons)]
31817 if __tmp.remaining() < Self::ENCODED_LEN {
31818 panic!(
31819 "buffer is too small (need {} bytes, but got {})",
31820 Self::ENCODED_LEN,
31821 __tmp.remaining(),
31822 )
31823 }
31824 __tmp.put_u64_le(self.usec);
31825 __tmp.put_f32_le(self.x);
31826 __tmp.put_f32_le(self.y);
31827 __tmp.put_f32_le(self.z);
31828 __tmp.put_f32_le(self.roll);
31829 __tmp.put_f32_le(self.pitch);
31830 __tmp.put_f32_le(self.yaw);
31831 if matches!(version, MavlinkVersion::V2) {
31832 for val in &self.covariance {
31833 __tmp.put_f32_le(*val);
31834 }
31835 let len = __tmp.len();
31836 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31837 } else {
31838 __tmp.len()
31839 }
31840 }
31841}
31842#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
31843#[doc = ""]
31844#[doc = "ID: 269"]
31845#[derive(Debug, Clone, PartialEq)]
31846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31847#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31848#[cfg_attr(feature = "ts", derive(TS))]
31849#[cfg_attr(feature = "ts", ts(export))]
31850pub struct VIDEO_STREAM_INFORMATION_DATA {
31851 #[doc = "Frame rate."]
31852 pub framerate: f32,
31853 #[doc = "Bit rate."]
31854 pub bitrate: u32,
31855 #[doc = "Bitmap of stream status flags."]
31856 pub flags: VideoStreamStatusFlags,
31857 #[doc = "Horizontal resolution."]
31858 pub resolution_h: u16,
31859 #[doc = "Vertical resolution."]
31860 pub resolution_v: u16,
31861 #[doc = "Video image rotation clockwise."]
31862 pub rotation: u16,
31863 #[doc = "Horizontal Field of view."]
31864 pub hfov: u16,
31865 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31866 pub stream_id: u8,
31867 #[doc = "Number of streams available."]
31868 pub count: u8,
31869 #[doc = "Type of stream."]
31870 pub mavtype: VideoStreamType,
31871 #[doc = "Stream name."]
31872 #[cfg_attr(
31873 feature = "serde",
31874 serde(
31875 serialize_with = "crate::nulstr::serialize::<_, 32>",
31876 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
31877 )
31878 )]
31879 #[cfg_attr(feature = "ts", ts(type = "string"))]
31880 pub name: [u8; 32],
31881 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
31882 #[cfg_attr(
31883 feature = "serde",
31884 serde(
31885 serialize_with = "crate::nulstr::serialize::<_, 160>",
31886 deserialize_with = "crate::nulstr::deserialize::<_, 160>"
31887 )
31888 )]
31889 #[cfg_attr(feature = "ts", ts(type = "string"))]
31890 pub uri: [u8; 160],
31891 #[doc = "Encoding of stream."]
31892 #[cfg_attr(feature = "serde", serde(default))]
31893 pub encoding: VideoStreamEncoding,
31894 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31895 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31896 pub camera_device_id: u8,
31897}
31898impl VIDEO_STREAM_INFORMATION_DATA {
31899 pub const ENCODED_LEN: usize = 215usize;
31900 pub const DEFAULT: Self = Self {
31901 framerate: 0.0_f32,
31902 bitrate: 0_u32,
31903 flags: VideoStreamStatusFlags::DEFAULT,
31904 resolution_h: 0_u16,
31905 resolution_v: 0_u16,
31906 rotation: 0_u16,
31907 hfov: 0_u16,
31908 stream_id: 0_u8,
31909 count: 0_u8,
31910 mavtype: VideoStreamType::DEFAULT,
31911 name: [0_u8; 32usize],
31912 uri: [0_u8; 160usize],
31913 encoding: VideoStreamEncoding::DEFAULT,
31914 camera_device_id: 0_u8,
31915 };
31916 #[cfg(feature = "arbitrary")]
31917 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31918 use arbitrary::{Arbitrary, Unstructured};
31919 let mut buf = [0u8; 1024];
31920 rng.fill_bytes(&mut buf);
31921 let mut unstructured = Unstructured::new(&buf);
31922 Self::arbitrary(&mut unstructured).unwrap_or_default()
31923 }
31924}
31925impl Default for VIDEO_STREAM_INFORMATION_DATA {
31926 fn default() -> Self {
31927 Self::DEFAULT.clone()
31928 }
31929}
31930impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
31931 type Message = MavMessage;
31932 const ID: u32 = 269u32;
31933 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
31934 const EXTRA_CRC: u8 = 109u8;
31935 const ENCODED_LEN: usize = 215usize;
31936 fn deser(
31937 _version: MavlinkVersion,
31938 __input: &[u8],
31939 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31940 let avail_len = __input.len();
31941 let mut payload_buf = [0; Self::ENCODED_LEN];
31942 let mut buf = if avail_len < Self::ENCODED_LEN {
31943 payload_buf[0..avail_len].copy_from_slice(__input);
31944 Bytes::new(&payload_buf)
31945 } else {
31946 Bytes::new(__input)
31947 };
31948 let mut __struct = Self::default();
31949 __struct.framerate = buf.get_f32_le();
31950 __struct.bitrate = buf.get_u32_le();
31951 let tmp = buf.get_u16_le();
31952 __struct.flags = VideoStreamStatusFlags::from_bits(
31953 tmp & VideoStreamStatusFlags::all().bits(),
31954 )
31955 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31956 flag_type: "VideoStreamStatusFlags",
31957 value: tmp as u32,
31958 })?;
31959 __struct.resolution_h = buf.get_u16_le();
31960 __struct.resolution_v = buf.get_u16_le();
31961 __struct.rotation = buf.get_u16_le();
31962 __struct.hfov = buf.get_u16_le();
31963 __struct.stream_id = buf.get_u8();
31964 __struct.count = buf.get_u8();
31965 let tmp = buf.get_u8();
31966 __struct.mavtype =
31967 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31968 enum_type: "VideoStreamType",
31969 value: tmp as u32,
31970 })?;
31971 for v in &mut __struct.name {
31972 let val = buf.get_u8();
31973 *v = val;
31974 }
31975 for v in &mut __struct.uri {
31976 let val = buf.get_u8();
31977 *v = val;
31978 }
31979 let tmp = buf.get_u8();
31980 __struct.encoding =
31981 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31982 enum_type: "VideoStreamEncoding",
31983 value: tmp as u32,
31984 })?;
31985 __struct.camera_device_id = buf.get_u8();
31986 Ok(__struct)
31987 }
31988 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31989 let mut __tmp = BytesMut::new(bytes);
31990 #[allow(clippy::absurd_extreme_comparisons)]
31991 #[allow(unused_comparisons)]
31992 if __tmp.remaining() < Self::ENCODED_LEN {
31993 panic!(
31994 "buffer is too small (need {} bytes, but got {})",
31995 Self::ENCODED_LEN,
31996 __tmp.remaining(),
31997 )
31998 }
31999 __tmp.put_f32_le(self.framerate);
32000 __tmp.put_u32_le(self.bitrate);
32001 __tmp.put_u16_le(self.flags.bits());
32002 __tmp.put_u16_le(self.resolution_h);
32003 __tmp.put_u16_le(self.resolution_v);
32004 __tmp.put_u16_le(self.rotation);
32005 __tmp.put_u16_le(self.hfov);
32006 __tmp.put_u8(self.stream_id);
32007 __tmp.put_u8(self.count);
32008 __tmp.put_u8(self.mavtype as u8);
32009 for val in &self.name {
32010 __tmp.put_u8(*val);
32011 }
32012 for val in &self.uri {
32013 __tmp.put_u8(*val);
32014 }
32015 if matches!(version, MavlinkVersion::V2) {
32016 __tmp.put_u8(self.encoding as u8);
32017 __tmp.put_u8(self.camera_device_id);
32018 let len = __tmp.len();
32019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32020 } else {
32021 __tmp.len()
32022 }
32023 }
32024}
32025#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32026#[doc = ""]
32027#[doc = "ID: 270"]
32028#[derive(Debug, Clone, PartialEq)]
32029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32031#[cfg_attr(feature = "ts", derive(TS))]
32032#[cfg_attr(feature = "ts", ts(export))]
32033pub struct VIDEO_STREAM_STATUS_DATA {
32034 #[doc = "Frame rate"]
32035 pub framerate: f32,
32036 #[doc = "Bit rate"]
32037 pub bitrate: u32,
32038 #[doc = "Bitmap of stream status flags"]
32039 pub flags: VideoStreamStatusFlags,
32040 #[doc = "Horizontal resolution"]
32041 pub resolution_h: u16,
32042 #[doc = "Vertical resolution"]
32043 pub resolution_v: u16,
32044 #[doc = "Video image rotation clockwise"]
32045 pub rotation: u16,
32046 #[doc = "Horizontal Field of view"]
32047 pub hfov: u16,
32048 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
32049 pub stream_id: u8,
32050 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32051 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32052 pub camera_device_id: u8,
32053}
32054impl VIDEO_STREAM_STATUS_DATA {
32055 pub const ENCODED_LEN: usize = 20usize;
32056 pub const DEFAULT: Self = Self {
32057 framerate: 0.0_f32,
32058 bitrate: 0_u32,
32059 flags: VideoStreamStatusFlags::DEFAULT,
32060 resolution_h: 0_u16,
32061 resolution_v: 0_u16,
32062 rotation: 0_u16,
32063 hfov: 0_u16,
32064 stream_id: 0_u8,
32065 camera_device_id: 0_u8,
32066 };
32067 #[cfg(feature = "arbitrary")]
32068 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32069 use arbitrary::{Arbitrary, Unstructured};
32070 let mut buf = [0u8; 1024];
32071 rng.fill_bytes(&mut buf);
32072 let mut unstructured = Unstructured::new(&buf);
32073 Self::arbitrary(&mut unstructured).unwrap_or_default()
32074 }
32075}
32076impl Default for VIDEO_STREAM_STATUS_DATA {
32077 fn default() -> Self {
32078 Self::DEFAULT.clone()
32079 }
32080}
32081impl MessageData for VIDEO_STREAM_STATUS_DATA {
32082 type Message = MavMessage;
32083 const ID: u32 = 270u32;
32084 const NAME: &'static str = "VIDEO_STREAM_STATUS";
32085 const EXTRA_CRC: u8 = 59u8;
32086 const ENCODED_LEN: usize = 20usize;
32087 fn deser(
32088 _version: MavlinkVersion,
32089 __input: &[u8],
32090 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32091 let avail_len = __input.len();
32092 let mut payload_buf = [0; Self::ENCODED_LEN];
32093 let mut buf = if avail_len < Self::ENCODED_LEN {
32094 payload_buf[0..avail_len].copy_from_slice(__input);
32095 Bytes::new(&payload_buf)
32096 } else {
32097 Bytes::new(__input)
32098 };
32099 let mut __struct = Self::default();
32100 __struct.framerate = buf.get_f32_le();
32101 __struct.bitrate = buf.get_u32_le();
32102 let tmp = buf.get_u16_le();
32103 __struct.flags = VideoStreamStatusFlags::from_bits(
32104 tmp & VideoStreamStatusFlags::all().bits(),
32105 )
32106 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32107 flag_type: "VideoStreamStatusFlags",
32108 value: tmp as u32,
32109 })?;
32110 __struct.resolution_h = buf.get_u16_le();
32111 __struct.resolution_v = buf.get_u16_le();
32112 __struct.rotation = buf.get_u16_le();
32113 __struct.hfov = buf.get_u16_le();
32114 __struct.stream_id = buf.get_u8();
32115 __struct.camera_device_id = buf.get_u8();
32116 Ok(__struct)
32117 }
32118 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32119 let mut __tmp = BytesMut::new(bytes);
32120 #[allow(clippy::absurd_extreme_comparisons)]
32121 #[allow(unused_comparisons)]
32122 if __tmp.remaining() < Self::ENCODED_LEN {
32123 panic!(
32124 "buffer is too small (need {} bytes, but got {})",
32125 Self::ENCODED_LEN,
32126 __tmp.remaining(),
32127 )
32128 }
32129 __tmp.put_f32_le(self.framerate);
32130 __tmp.put_u32_le(self.bitrate);
32131 __tmp.put_u16_le(self.flags.bits());
32132 __tmp.put_u16_le(self.resolution_h);
32133 __tmp.put_u16_le(self.resolution_v);
32134 __tmp.put_u16_le(self.rotation);
32135 __tmp.put_u16_le(self.hfov);
32136 __tmp.put_u8(self.stream_id);
32137 if matches!(version, MavlinkVersion::V2) {
32138 __tmp.put_u8(self.camera_device_id);
32139 let len = __tmp.len();
32140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32141 } else {
32142 __tmp.len()
32143 }
32144 }
32145}
32146#[doc = "Local position/attitude estimate from a vision source."]
32147#[doc = ""]
32148#[doc = "ID: 102"]
32149#[derive(Debug, Clone, PartialEq)]
32150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32152#[cfg_attr(feature = "ts", derive(TS))]
32153#[cfg_attr(feature = "ts", ts(export))]
32154pub struct VISION_POSITION_ESTIMATE_DATA {
32155 #[doc = "Timestamp (UNIX time or time since system boot)"]
32156 pub usec: u64,
32157 #[doc = "Local X position"]
32158 pub x: f32,
32159 #[doc = "Local Y position"]
32160 pub y: f32,
32161 #[doc = "Local Z position"]
32162 pub z: f32,
32163 #[doc = "Roll angle"]
32164 pub roll: f32,
32165 #[doc = "Pitch angle"]
32166 pub pitch: f32,
32167 #[doc = "Yaw angle"]
32168 pub yaw: f32,
32169 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
32170 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32171 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32172 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32173 pub covariance: [f32; 21],
32174 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32175 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32176 pub reset_counter: u8,
32177}
32178impl VISION_POSITION_ESTIMATE_DATA {
32179 pub const ENCODED_LEN: usize = 117usize;
32180 pub const DEFAULT: Self = Self {
32181 usec: 0_u64,
32182 x: 0.0_f32,
32183 y: 0.0_f32,
32184 z: 0.0_f32,
32185 roll: 0.0_f32,
32186 pitch: 0.0_f32,
32187 yaw: 0.0_f32,
32188 covariance: [0.0_f32; 21usize],
32189 reset_counter: 0_u8,
32190 };
32191 #[cfg(feature = "arbitrary")]
32192 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32193 use arbitrary::{Arbitrary, Unstructured};
32194 let mut buf = [0u8; 1024];
32195 rng.fill_bytes(&mut buf);
32196 let mut unstructured = Unstructured::new(&buf);
32197 Self::arbitrary(&mut unstructured).unwrap_or_default()
32198 }
32199}
32200impl Default for VISION_POSITION_ESTIMATE_DATA {
32201 fn default() -> Self {
32202 Self::DEFAULT.clone()
32203 }
32204}
32205impl MessageData for VISION_POSITION_ESTIMATE_DATA {
32206 type Message = MavMessage;
32207 const ID: u32 = 102u32;
32208 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
32209 const EXTRA_CRC: u8 = 158u8;
32210 const ENCODED_LEN: usize = 117usize;
32211 fn deser(
32212 _version: MavlinkVersion,
32213 __input: &[u8],
32214 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32215 let avail_len = __input.len();
32216 let mut payload_buf = [0; Self::ENCODED_LEN];
32217 let mut buf = if avail_len < Self::ENCODED_LEN {
32218 payload_buf[0..avail_len].copy_from_slice(__input);
32219 Bytes::new(&payload_buf)
32220 } else {
32221 Bytes::new(__input)
32222 };
32223 let mut __struct = Self::default();
32224 __struct.usec = buf.get_u64_le();
32225 __struct.x = buf.get_f32_le();
32226 __struct.y = buf.get_f32_le();
32227 __struct.z = buf.get_f32_le();
32228 __struct.roll = buf.get_f32_le();
32229 __struct.pitch = buf.get_f32_le();
32230 __struct.yaw = buf.get_f32_le();
32231 for v in &mut __struct.covariance {
32232 let val = buf.get_f32_le();
32233 *v = val;
32234 }
32235 __struct.reset_counter = buf.get_u8();
32236 Ok(__struct)
32237 }
32238 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32239 let mut __tmp = BytesMut::new(bytes);
32240 #[allow(clippy::absurd_extreme_comparisons)]
32241 #[allow(unused_comparisons)]
32242 if __tmp.remaining() < Self::ENCODED_LEN {
32243 panic!(
32244 "buffer is too small (need {} bytes, but got {})",
32245 Self::ENCODED_LEN,
32246 __tmp.remaining(),
32247 )
32248 }
32249 __tmp.put_u64_le(self.usec);
32250 __tmp.put_f32_le(self.x);
32251 __tmp.put_f32_le(self.y);
32252 __tmp.put_f32_le(self.z);
32253 __tmp.put_f32_le(self.roll);
32254 __tmp.put_f32_le(self.pitch);
32255 __tmp.put_f32_le(self.yaw);
32256 if matches!(version, MavlinkVersion::V2) {
32257 for val in &self.covariance {
32258 __tmp.put_f32_le(*val);
32259 }
32260 __tmp.put_u8(self.reset_counter);
32261 let len = __tmp.len();
32262 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32263 } else {
32264 __tmp.len()
32265 }
32266 }
32267}
32268#[doc = "Speed estimate from a vision source."]
32269#[doc = ""]
32270#[doc = "ID: 103"]
32271#[derive(Debug, Clone, PartialEq)]
32272#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32274#[cfg_attr(feature = "ts", derive(TS))]
32275#[cfg_attr(feature = "ts", ts(export))]
32276pub struct VISION_SPEED_ESTIMATE_DATA {
32277 #[doc = "Timestamp (UNIX time or time since system boot)"]
32278 pub usec: u64,
32279 #[doc = "Global X speed"]
32280 pub x: f32,
32281 #[doc = "Global Y speed"]
32282 pub y: f32,
32283 #[doc = "Global Z speed"]
32284 pub z: f32,
32285 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
32286 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32287 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32288 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32289 pub covariance: [f32; 9],
32290 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32291 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32292 pub reset_counter: u8,
32293}
32294impl VISION_SPEED_ESTIMATE_DATA {
32295 pub const ENCODED_LEN: usize = 57usize;
32296 pub const DEFAULT: Self = Self {
32297 usec: 0_u64,
32298 x: 0.0_f32,
32299 y: 0.0_f32,
32300 z: 0.0_f32,
32301 covariance: [0.0_f32; 9usize],
32302 reset_counter: 0_u8,
32303 };
32304 #[cfg(feature = "arbitrary")]
32305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32306 use arbitrary::{Arbitrary, Unstructured};
32307 let mut buf = [0u8; 1024];
32308 rng.fill_bytes(&mut buf);
32309 let mut unstructured = Unstructured::new(&buf);
32310 Self::arbitrary(&mut unstructured).unwrap_or_default()
32311 }
32312}
32313impl Default for VISION_SPEED_ESTIMATE_DATA {
32314 fn default() -> Self {
32315 Self::DEFAULT.clone()
32316 }
32317}
32318impl MessageData for VISION_SPEED_ESTIMATE_DATA {
32319 type Message = MavMessage;
32320 const ID: u32 = 103u32;
32321 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
32322 const EXTRA_CRC: u8 = 208u8;
32323 const ENCODED_LEN: usize = 57usize;
32324 fn deser(
32325 _version: MavlinkVersion,
32326 __input: &[u8],
32327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32328 let avail_len = __input.len();
32329 let mut payload_buf = [0; Self::ENCODED_LEN];
32330 let mut buf = if avail_len < Self::ENCODED_LEN {
32331 payload_buf[0..avail_len].copy_from_slice(__input);
32332 Bytes::new(&payload_buf)
32333 } else {
32334 Bytes::new(__input)
32335 };
32336 let mut __struct = Self::default();
32337 __struct.usec = buf.get_u64_le();
32338 __struct.x = buf.get_f32_le();
32339 __struct.y = buf.get_f32_le();
32340 __struct.z = buf.get_f32_le();
32341 for v in &mut __struct.covariance {
32342 let val = buf.get_f32_le();
32343 *v = val;
32344 }
32345 __struct.reset_counter = buf.get_u8();
32346 Ok(__struct)
32347 }
32348 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32349 let mut __tmp = BytesMut::new(bytes);
32350 #[allow(clippy::absurd_extreme_comparisons)]
32351 #[allow(unused_comparisons)]
32352 if __tmp.remaining() < Self::ENCODED_LEN {
32353 panic!(
32354 "buffer is too small (need {} bytes, but got {})",
32355 Self::ENCODED_LEN,
32356 __tmp.remaining(),
32357 )
32358 }
32359 __tmp.put_u64_le(self.usec);
32360 __tmp.put_f32_le(self.x);
32361 __tmp.put_f32_le(self.y);
32362 __tmp.put_f32_le(self.z);
32363 if matches!(version, MavlinkVersion::V2) {
32364 for val in &self.covariance {
32365 __tmp.put_f32_le(*val);
32366 }
32367 __tmp.put_u8(self.reset_counter);
32368 let len = __tmp.len();
32369 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32370 } else {
32371 __tmp.len()
32372 }
32373 }
32374}
32375#[doc = "Cumulative distance traveled for each reported wheel."]
32376#[doc = ""]
32377#[doc = "ID: 9000"]
32378#[derive(Debug, Clone, PartialEq)]
32379#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32380#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32381#[cfg_attr(feature = "ts", derive(TS))]
32382#[cfg_attr(feature = "ts", ts(export))]
32383pub struct WHEEL_DISTANCE_DATA {
32384 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32385 pub time_usec: u64,
32386 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
32387 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32388 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32389 pub distance: [f64; 16],
32390 #[doc = "Number of wheels reported."]
32391 pub count: u8,
32392}
32393impl WHEEL_DISTANCE_DATA {
32394 pub const ENCODED_LEN: usize = 137usize;
32395 pub const DEFAULT: Self = Self {
32396 time_usec: 0_u64,
32397 distance: [0.0_f64; 16usize],
32398 count: 0_u8,
32399 };
32400 #[cfg(feature = "arbitrary")]
32401 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32402 use arbitrary::{Arbitrary, Unstructured};
32403 let mut buf = [0u8; 1024];
32404 rng.fill_bytes(&mut buf);
32405 let mut unstructured = Unstructured::new(&buf);
32406 Self::arbitrary(&mut unstructured).unwrap_or_default()
32407 }
32408}
32409impl Default for WHEEL_DISTANCE_DATA {
32410 fn default() -> Self {
32411 Self::DEFAULT.clone()
32412 }
32413}
32414impl MessageData for WHEEL_DISTANCE_DATA {
32415 type Message = MavMessage;
32416 const ID: u32 = 9000u32;
32417 const NAME: &'static str = "WHEEL_DISTANCE";
32418 const EXTRA_CRC: u8 = 113u8;
32419 const ENCODED_LEN: usize = 137usize;
32420 fn deser(
32421 _version: MavlinkVersion,
32422 __input: &[u8],
32423 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32424 let avail_len = __input.len();
32425 let mut payload_buf = [0; Self::ENCODED_LEN];
32426 let mut buf = if avail_len < Self::ENCODED_LEN {
32427 payload_buf[0..avail_len].copy_from_slice(__input);
32428 Bytes::new(&payload_buf)
32429 } else {
32430 Bytes::new(__input)
32431 };
32432 let mut __struct = Self::default();
32433 __struct.time_usec = buf.get_u64_le();
32434 for v in &mut __struct.distance {
32435 let val = buf.get_f64_le();
32436 *v = val;
32437 }
32438 __struct.count = buf.get_u8();
32439 Ok(__struct)
32440 }
32441 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32442 let mut __tmp = BytesMut::new(bytes);
32443 #[allow(clippy::absurd_extreme_comparisons)]
32444 #[allow(unused_comparisons)]
32445 if __tmp.remaining() < Self::ENCODED_LEN {
32446 panic!(
32447 "buffer is too small (need {} bytes, but got {})",
32448 Self::ENCODED_LEN,
32449 __tmp.remaining(),
32450 )
32451 }
32452 __tmp.put_u64_le(self.time_usec);
32453 for val in &self.distance {
32454 __tmp.put_f64_le(*val);
32455 }
32456 __tmp.put_u8(self.count);
32457 if matches!(version, MavlinkVersion::V2) {
32458 let len = __tmp.len();
32459 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32460 } else {
32461 __tmp.len()
32462 }
32463 }
32464}
32465#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32466#[doc = ""]
32467#[doc = "ID: 299"]
32468#[derive(Debug, Clone, PartialEq)]
32469#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32470#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32471#[cfg_attr(feature = "ts", derive(TS))]
32472#[cfg_attr(feature = "ts", ts(export))]
32473pub struct WIFI_CONFIG_AP_DATA {
32474 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
32475 #[cfg_attr(
32476 feature = "serde",
32477 serde(
32478 serialize_with = "crate::nulstr::serialize::<_, 32>",
32479 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
32480 )
32481 )]
32482 #[cfg_attr(feature = "ts", ts(type = "string"))]
32483 pub ssid: [u8; 32],
32484 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
32485 #[cfg_attr(
32486 feature = "serde",
32487 serde(
32488 serialize_with = "crate::nulstr::serialize::<_, 64>",
32489 deserialize_with = "crate::nulstr::deserialize::<_, 64>"
32490 )
32491 )]
32492 #[cfg_attr(feature = "ts", ts(type = "string"))]
32493 pub password: [u8; 64],
32494 #[doc = "WiFi Mode."]
32495 #[cfg_attr(feature = "serde", serde(default))]
32496 pub mode: WifiConfigApMode,
32497 #[doc = "Message acceptance response (sent back to GS)."]
32498 #[cfg_attr(feature = "serde", serde(default))]
32499 pub response: WifiConfigApResponse,
32500}
32501impl WIFI_CONFIG_AP_DATA {
32502 pub const ENCODED_LEN: usize = 98usize;
32503 pub const DEFAULT: Self = Self {
32504 ssid: [0_u8; 32usize],
32505 password: [0_u8; 64usize],
32506 mode: WifiConfigApMode::DEFAULT,
32507 response: WifiConfigApResponse::DEFAULT,
32508 };
32509 #[cfg(feature = "arbitrary")]
32510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32511 use arbitrary::{Arbitrary, Unstructured};
32512 let mut buf = [0u8; 1024];
32513 rng.fill_bytes(&mut buf);
32514 let mut unstructured = Unstructured::new(&buf);
32515 Self::arbitrary(&mut unstructured).unwrap_or_default()
32516 }
32517}
32518impl Default for WIFI_CONFIG_AP_DATA {
32519 fn default() -> Self {
32520 Self::DEFAULT.clone()
32521 }
32522}
32523impl MessageData for WIFI_CONFIG_AP_DATA {
32524 type Message = MavMessage;
32525 const ID: u32 = 299u32;
32526 const NAME: &'static str = "WIFI_CONFIG_AP";
32527 const EXTRA_CRC: u8 = 19u8;
32528 const ENCODED_LEN: usize = 98usize;
32529 fn deser(
32530 _version: MavlinkVersion,
32531 __input: &[u8],
32532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32533 let avail_len = __input.len();
32534 let mut payload_buf = [0; Self::ENCODED_LEN];
32535 let mut buf = if avail_len < Self::ENCODED_LEN {
32536 payload_buf[0..avail_len].copy_from_slice(__input);
32537 Bytes::new(&payload_buf)
32538 } else {
32539 Bytes::new(__input)
32540 };
32541 let mut __struct = Self::default();
32542 for v in &mut __struct.ssid {
32543 let val = buf.get_u8();
32544 *v = val;
32545 }
32546 for v in &mut __struct.password {
32547 let val = buf.get_u8();
32548 *v = val;
32549 }
32550 let tmp = buf.get_i8();
32551 __struct.mode =
32552 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32553 enum_type: "WifiConfigApMode",
32554 value: tmp as u32,
32555 })?;
32556 let tmp = buf.get_i8();
32557 __struct.response =
32558 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32559 enum_type: "WifiConfigApResponse",
32560 value: tmp as u32,
32561 })?;
32562 Ok(__struct)
32563 }
32564 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32565 let mut __tmp = BytesMut::new(bytes);
32566 #[allow(clippy::absurd_extreme_comparisons)]
32567 #[allow(unused_comparisons)]
32568 if __tmp.remaining() < Self::ENCODED_LEN {
32569 panic!(
32570 "buffer is too small (need {} bytes, but got {})",
32571 Self::ENCODED_LEN,
32572 __tmp.remaining(),
32573 )
32574 }
32575 for val in &self.ssid {
32576 __tmp.put_u8(*val);
32577 }
32578 for val in &self.password {
32579 __tmp.put_u8(*val);
32580 }
32581 if matches!(version, MavlinkVersion::V2) {
32582 __tmp.put_i8(self.mode as i8);
32583 __tmp.put_i8(self.response as i8);
32584 let len = __tmp.len();
32585 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32586 } else {
32587 __tmp.len()
32588 }
32589 }
32590}
32591#[doc = "Winch status."]
32592#[doc = ""]
32593#[doc = "ID: 9005"]
32594#[derive(Debug, Clone, PartialEq)]
32595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32597#[cfg_attr(feature = "ts", derive(TS))]
32598#[cfg_attr(feature = "ts", ts(export))]
32599pub struct WINCH_STATUS_DATA {
32600 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32601 pub time_usec: u64,
32602 #[doc = "Length of line released. NaN if unknown"]
32603 pub line_length: f32,
32604 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
32605 pub speed: f32,
32606 #[doc = "Tension on the line. NaN if unknown"]
32607 pub tension: f32,
32608 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
32609 pub voltage: f32,
32610 #[doc = "Current draw from the winch. NaN if unknown"]
32611 pub current: f32,
32612 #[doc = "Status flags"]
32613 pub status: MavWinchStatusFlag,
32614 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
32615 pub temperature: i16,
32616}
32617impl WINCH_STATUS_DATA {
32618 pub const ENCODED_LEN: usize = 34usize;
32619 pub const DEFAULT: Self = Self {
32620 time_usec: 0_u64,
32621 line_length: 0.0_f32,
32622 speed: 0.0_f32,
32623 tension: 0.0_f32,
32624 voltage: 0.0_f32,
32625 current: 0.0_f32,
32626 status: MavWinchStatusFlag::DEFAULT,
32627 temperature: 0_i16,
32628 };
32629 #[cfg(feature = "arbitrary")]
32630 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32631 use arbitrary::{Arbitrary, Unstructured};
32632 let mut buf = [0u8; 1024];
32633 rng.fill_bytes(&mut buf);
32634 let mut unstructured = Unstructured::new(&buf);
32635 Self::arbitrary(&mut unstructured).unwrap_or_default()
32636 }
32637}
32638impl Default for WINCH_STATUS_DATA {
32639 fn default() -> Self {
32640 Self::DEFAULT.clone()
32641 }
32642}
32643impl MessageData for WINCH_STATUS_DATA {
32644 type Message = MavMessage;
32645 const ID: u32 = 9005u32;
32646 const NAME: &'static str = "WINCH_STATUS";
32647 const EXTRA_CRC: u8 = 117u8;
32648 const ENCODED_LEN: usize = 34usize;
32649 fn deser(
32650 _version: MavlinkVersion,
32651 __input: &[u8],
32652 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32653 let avail_len = __input.len();
32654 let mut payload_buf = [0; Self::ENCODED_LEN];
32655 let mut buf = if avail_len < Self::ENCODED_LEN {
32656 payload_buf[0..avail_len].copy_from_slice(__input);
32657 Bytes::new(&payload_buf)
32658 } else {
32659 Bytes::new(__input)
32660 };
32661 let mut __struct = Self::default();
32662 __struct.time_usec = buf.get_u64_le();
32663 __struct.line_length = buf.get_f32_le();
32664 __struct.speed = buf.get_f32_le();
32665 __struct.tension = buf.get_f32_le();
32666 __struct.voltage = buf.get_f32_le();
32667 __struct.current = buf.get_f32_le();
32668 let tmp = buf.get_u32_le();
32669 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
32670 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32671 flag_type: "MavWinchStatusFlag",
32672 value: tmp as u32,
32673 })?;
32674 __struct.temperature = buf.get_i16_le();
32675 Ok(__struct)
32676 }
32677 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32678 let mut __tmp = BytesMut::new(bytes);
32679 #[allow(clippy::absurd_extreme_comparisons)]
32680 #[allow(unused_comparisons)]
32681 if __tmp.remaining() < Self::ENCODED_LEN {
32682 panic!(
32683 "buffer is too small (need {} bytes, but got {})",
32684 Self::ENCODED_LEN,
32685 __tmp.remaining(),
32686 )
32687 }
32688 __tmp.put_u64_le(self.time_usec);
32689 __tmp.put_f32_le(self.line_length);
32690 __tmp.put_f32_le(self.speed);
32691 __tmp.put_f32_le(self.tension);
32692 __tmp.put_f32_le(self.voltage);
32693 __tmp.put_f32_le(self.current);
32694 __tmp.put_u32_le(self.status.bits());
32695 __tmp.put_i16_le(self.temperature);
32696 if matches!(version, MavlinkVersion::V2) {
32697 let len = __tmp.len();
32698 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32699 } else {
32700 __tmp.len()
32701 }
32702 }
32703}
32704#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32705#[doc = ""]
32706#[doc = "ID: 231"]
32707#[derive(Debug, Clone, PartialEq)]
32708#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32709#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32710#[cfg_attr(feature = "ts", derive(TS))]
32711#[cfg_attr(feature = "ts", ts(export))]
32712pub struct WIND_COV_DATA {
32713 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32714 pub time_usec: u64,
32715 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
32716 pub wind_x: f32,
32717 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
32718 pub wind_y: f32,
32719 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
32720 pub wind_z: f32,
32721 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32722 pub var_horiz: f32,
32723 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32724 pub var_vert: f32,
32725 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
32726 pub wind_alt: f32,
32727 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
32728 pub horiz_accuracy: f32,
32729 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
32730 pub vert_accuracy: f32,
32731}
32732impl WIND_COV_DATA {
32733 pub const ENCODED_LEN: usize = 40usize;
32734 pub const DEFAULT: Self = Self {
32735 time_usec: 0_u64,
32736 wind_x: 0.0_f32,
32737 wind_y: 0.0_f32,
32738 wind_z: 0.0_f32,
32739 var_horiz: 0.0_f32,
32740 var_vert: 0.0_f32,
32741 wind_alt: 0.0_f32,
32742 horiz_accuracy: 0.0_f32,
32743 vert_accuracy: 0.0_f32,
32744 };
32745 #[cfg(feature = "arbitrary")]
32746 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32747 use arbitrary::{Arbitrary, Unstructured};
32748 let mut buf = [0u8; 1024];
32749 rng.fill_bytes(&mut buf);
32750 let mut unstructured = Unstructured::new(&buf);
32751 Self::arbitrary(&mut unstructured).unwrap_or_default()
32752 }
32753}
32754impl Default for WIND_COV_DATA {
32755 fn default() -> Self {
32756 Self::DEFAULT.clone()
32757 }
32758}
32759impl MessageData for WIND_COV_DATA {
32760 type Message = MavMessage;
32761 const ID: u32 = 231u32;
32762 const NAME: &'static str = "WIND_COV";
32763 const EXTRA_CRC: u8 = 105u8;
32764 const ENCODED_LEN: usize = 40usize;
32765 fn deser(
32766 _version: MavlinkVersion,
32767 __input: &[u8],
32768 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32769 let avail_len = __input.len();
32770 let mut payload_buf = [0; Self::ENCODED_LEN];
32771 let mut buf = if avail_len < Self::ENCODED_LEN {
32772 payload_buf[0..avail_len].copy_from_slice(__input);
32773 Bytes::new(&payload_buf)
32774 } else {
32775 Bytes::new(__input)
32776 };
32777 let mut __struct = Self::default();
32778 __struct.time_usec = buf.get_u64_le();
32779 __struct.wind_x = buf.get_f32_le();
32780 __struct.wind_y = buf.get_f32_le();
32781 __struct.wind_z = buf.get_f32_le();
32782 __struct.var_horiz = buf.get_f32_le();
32783 __struct.var_vert = buf.get_f32_le();
32784 __struct.wind_alt = buf.get_f32_le();
32785 __struct.horiz_accuracy = buf.get_f32_le();
32786 __struct.vert_accuracy = buf.get_f32_le();
32787 Ok(__struct)
32788 }
32789 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32790 let mut __tmp = BytesMut::new(bytes);
32791 #[allow(clippy::absurd_extreme_comparisons)]
32792 #[allow(unused_comparisons)]
32793 if __tmp.remaining() < Self::ENCODED_LEN {
32794 panic!(
32795 "buffer is too small (need {} bytes, but got {})",
32796 Self::ENCODED_LEN,
32797 __tmp.remaining(),
32798 )
32799 }
32800 __tmp.put_u64_le(self.time_usec);
32801 __tmp.put_f32_le(self.wind_x);
32802 __tmp.put_f32_le(self.wind_y);
32803 __tmp.put_f32_le(self.wind_z);
32804 __tmp.put_f32_le(self.var_horiz);
32805 __tmp.put_f32_le(self.var_vert);
32806 __tmp.put_f32_le(self.wind_alt);
32807 __tmp.put_f32_le(self.horiz_accuracy);
32808 __tmp.put_f32_le(self.vert_accuracy);
32809 if matches!(version, MavlinkVersion::V2) {
32810 let len = __tmp.len();
32811 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32812 } else {
32813 __tmp.len()
32814 }
32815 }
32816}
32817#[derive(Clone, PartialEq, Debug)]
32818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32819#[cfg_attr(feature = "serde", serde(tag = "type"))]
32820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32821#[cfg_attr(feature = "ts", derive(TS))]
32822#[cfg_attr(feature = "ts", ts(export))]
32823#[repr(u32)]
32824pub enum MavMessage {
32825 #[doc = "Set the vehicle attitude and body angular rates."]
32826 #[doc = ""]
32827 #[doc = "ID: 140"]
32828 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
32829 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
32830 #[doc = ""]
32831 #[doc = "ID: 375"]
32832 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
32833 #[doc = "The location and information of an ADSB vehicle."]
32834 #[doc = ""]
32835 #[doc = "ID: 246"]
32836 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
32837 #[doc = "The location and information of an AIS vessel."]
32838 #[doc = ""]
32839 #[doc = "ID: 301"]
32840 AIS_VESSEL(AIS_VESSEL_DATA),
32841 #[doc = "The current system altitude."]
32842 #[doc = ""]
32843 #[doc = "ID: 141"]
32844 ALTITUDE(ALTITUDE_DATA),
32845 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
32846 #[doc = ""]
32847 #[doc = "ID: 30"]
32848 ATTITUDE(ATTITUDE_DATA),
32849 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32850 #[doc = ""]
32851 #[doc = "ID: 31"]
32852 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
32853 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32854 #[doc = ""]
32855 #[doc = "ID: 61"]
32856 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
32857 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
32858 #[doc = ""]
32859 #[doc = "ID: 83"]
32860 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
32861 #[doc = "Motion capture attitude and position."]
32862 #[doc = ""]
32863 #[doc = "ID: 138"]
32864 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
32865 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
32866 #[doc = ""]
32867 #[doc = "ID: 7"]
32868 AUTH_KEY(AUTH_KEY_DATA),
32869 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
32870 #[doc = ""]
32871 #[doc = "ID: 286"]
32872 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
32873 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
32874 #[doc = ""]
32875 #[doc = "ID: 148"]
32876 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
32877 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
32878 #[doc = ""]
32879 #[doc = "ID: 435"]
32880 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
32881 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
32882 #[doc = ""]
32883 #[doc = "ID: 437"]
32884 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
32885 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
32886 #[doc = ""]
32887 #[doc = "ID: 372"]
32888 BATTERY_INFO(BATTERY_INFO_DATA),
32889 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
32890 #[doc = ""]
32891 #[doc = "ID: 147"]
32892 BATTERY_STATUS(BATTERY_STATUS_DATA),
32893 #[doc = "Report button state change."]
32894 #[doc = ""]
32895 #[doc = "ID: 257"]
32896 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
32897 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32898 #[doc = ""]
32899 #[doc = "ID: 262"]
32900 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
32901 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32902 #[doc = ""]
32903 #[doc = "ID: 271"]
32904 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
32905 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
32906 #[doc = ""]
32907 #[doc = "ID: 263"]
32908 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
32909 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32910 #[doc = ""]
32911 #[doc = "ID: 259"]
32912 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
32913 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32914 #[doc = ""]
32915 #[doc = "ID: 260"]
32916 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
32917 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
32918 #[doc = ""]
32919 #[doc = "ID: 277"]
32920 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
32921 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32922 #[doc = ""]
32923 #[doc = "ID: 276"]
32924 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
32925 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32926 #[doc = ""]
32927 #[doc = "ID: 275"]
32928 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
32929 #[doc = "Camera-IMU triggering and synchronisation message."]
32930 #[doc = ""]
32931 #[doc = "ID: 112"]
32932 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
32933 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
32934 #[doc = ""]
32935 #[doc = "ID: 387"]
32936 CANFD_FRAME(CANFD_FRAME_DATA),
32937 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
32938 #[doc = ""]
32939 #[doc = "ID: 388"]
32940 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
32941 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
32942 #[doc = ""]
32943 #[doc = "ID: 386"]
32944 CAN_FRAME(CAN_FRAME_DATA),
32945 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32946 #[doc = ""]
32947 #[doc = "ID: 336"]
32948 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
32949 #[doc = "Report current used cellular network status."]
32950 #[doc = ""]
32951 #[doc = "ID: 334"]
32952 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
32953 #[doc = "Request to control this MAV."]
32954 #[doc = ""]
32955 #[doc = "ID: 5"]
32956 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
32957 #[doc = "Accept / deny control of this MAV."]
32958 #[doc = ""]
32959 #[doc = "ID: 6"]
32960 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
32961 #[doc = "Information about a potential collision."]
32962 #[doc = ""]
32963 #[doc = "ID: 247"]
32964 COLLISION(COLLISION_DATA),
32965 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32966 #[doc = ""]
32967 #[doc = "ID: 77"]
32968 COMMAND_ACK(COMMAND_ACK_DATA),
32969 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32970 #[doc = ""]
32971 #[doc = "ID: 80"]
32972 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
32973 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32974 #[doc = ""]
32975 #[doc = "ID: 75"]
32976 COMMAND_INT(COMMAND_INT_DATA),
32977 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32978 #[doc = ""]
32979 #[doc = "ID: 76"]
32980 COMMAND_LONG(COMMAND_LONG_DATA),
32981 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
32982 #[doc = ""]
32983 #[doc = "ID: 395"]
32984 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
32985 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
32986 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
32987 #[doc = ""]
32988 #[doc = "ID: 396"]
32989 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
32990 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
32991 #[doc = ""]
32992 #[doc = "ID: 397"]
32993 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
32994 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
32995 #[doc = ""]
32996 #[doc = "ID: 146"]
32997 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
32998 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
32999 #[doc = ""]
33000 #[doc = "ID: 411"]
33001 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
33002 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
33003 #[doc = ""]
33004 #[doc = "ID: 436"]
33005 CURRENT_MODE(CURRENT_MODE_DATA),
33006 #[doc = "Data stream status information."]
33007 #[doc = ""]
33008 #[doc = "ID: 67"]
33009 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
33010 DATA_STREAM(DATA_STREAM_DATA),
33011 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
33012 #[doc = ""]
33013 #[doc = "ID: 130"]
33014 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
33015 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
33016 #[doc = ""]
33017 #[doc = "ID: 254"]
33018 DEBUG(DEBUG_DATA),
33019 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
33020 #[doc = ""]
33021 #[doc = "ID: 350"]
33022 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
33023 #[doc = "To debug something using a named 3D vector."]
33024 #[doc = ""]
33025 #[doc = "ID: 250"]
33026 DEBUG_VECT(DEBUG_VECT_DATA),
33027 #[doc = "Distance sensor information for an onboard rangefinder."]
33028 #[doc = ""]
33029 #[doc = "ID: 132"]
33030 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
33031 #[doc = "EFI status output."]
33032 #[doc = ""]
33033 #[doc = "ID: 225"]
33034 EFI_STATUS(EFI_STATUS_DATA),
33035 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
33036 #[doc = ""]
33037 #[doc = "ID: 131"]
33038 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
33039 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
33040 #[doc = ""]
33041 #[doc = "ID: 290"]
33042 ESC_INFO(ESC_INFO_DATA),
33043 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
33044 #[doc = ""]
33045 #[doc = "ID: 291"]
33046 ESC_STATUS(ESC_STATUS_DATA),
33047 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
33048 #[doc = ""]
33049 #[doc = "ID: 230"]
33050 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
33051 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
33052 #[doc = ""]
33053 #[doc = "ID: 410"]
33054 EVENT(EVENT_DATA),
33055 #[doc = "Provides state for additional features."]
33056 #[doc = ""]
33057 #[doc = "ID: 245"]
33058 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
33059 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
33060 #[doc = ""]
33061 #[doc = "ID: 162"]
33062 FENCE_STATUS(FENCE_STATUS_DATA),
33063 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
33064 #[doc = ""]
33065 #[doc = "ID: 110"]
33066 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
33067 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
33068 #[doc = ""]
33069 #[doc = "ID: 264"]
33070 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
33071 #[doc = "Current motion information from a designated system."]
33072 #[doc = ""]
33073 #[doc = "ID: 144"]
33074 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
33075 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
33076 #[doc = ""]
33077 #[doc = "ID: 371"]
33078 FUEL_STATUS(FUEL_STATUS_DATA),
33079 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
33080 #[doc = ""]
33081 #[doc = "ID: 373"]
33082 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
33083 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
33084 #[doc = ""]
33085 #[doc = "ID: 285"]
33086 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
33087 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
33088 #[doc = ""]
33089 #[doc = "ID: 283"]
33090 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
33091 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
33092 #[doc = ""]
33093 #[doc = "ID: 284"]
33094 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
33095 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
33096 #[doc = ""]
33097 #[doc = "ID: 280"]
33098 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
33099 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
33100 #[doc = ""]
33101 #[doc = "ID: 282"]
33102 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
33103 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
33104 #[doc = ""]
33105 #[doc = "ID: 288"]
33106 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
33107 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
33108 #[doc = ""]
33109 #[doc = "ID: 287"]
33110 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
33111 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
33112 #[doc = ""]
33113 #[doc = "ID: 281"]
33114 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
33115 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
33116 #[doc = ""]
33117 #[doc = "ID: 33"]
33118 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
33119 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
33120 #[doc = ""]
33121 #[doc = "ID: 63"]
33122 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
33123 #[doc = "Global position/attitude estimate from a vision source."]
33124 #[doc = ""]
33125 #[doc = "ID: 101"]
33126 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
33127 #[doc = "Second GPS data."]
33128 #[doc = ""]
33129 #[doc = "ID: 124"]
33130 GPS2_RAW(GPS2_RAW_DATA),
33131 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
33132 #[doc = ""]
33133 #[doc = "ID: 128"]
33134 GPS2_RTK(GPS2_RTK_DATA),
33135 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
33136 #[doc = ""]
33137 #[doc = "ID: 49"]
33138 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
33139 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
33140 #[doc = ""]
33141 #[doc = "ID: 123"]
33142 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
33143 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
33144 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
33145 #[doc = ""]
33146 #[doc = "ID: 232"]
33147 GPS_INPUT(GPS_INPUT_DATA),
33148 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
33149 #[doc = ""]
33150 #[doc = "ID: 24"]
33151 GPS_RAW_INT(GPS_RAW_INT_DATA),
33152 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
33153 #[doc = ""]
33154 #[doc = "ID: 233"]
33155 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
33156 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
33157 #[doc = ""]
33158 #[doc = "ID: 127"]
33159 GPS_RTK(GPS_RTK_DATA),
33160 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
33161 #[doc = ""]
33162 #[doc = "ID: 25"]
33163 GPS_STATUS(GPS_STATUS_DATA),
33164 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
33165 #[doc = ""]
33166 #[doc = "ID: 0"]
33167 HEARTBEAT(HEARTBEAT_DATA),
33168 #[doc = "The IMU readings in SI units in NED body frame."]
33169 #[doc = ""]
33170 #[doc = "ID: 105"]
33171 HIGHRES_IMU(HIGHRES_IMU_DATA),
33172 #[doc = "Message appropriate for high latency connections like Iridium."]
33173 #[doc = ""]
33174 #[doc = "ID: 234"]
33175 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
33176 HIGH_LATENCY(HIGH_LATENCY_DATA),
33177 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
33178 #[doc = ""]
33179 #[doc = "ID: 235"]
33180 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
33181 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
33182 #[doc = ""]
33183 #[doc = "ID: 93"]
33184 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
33185 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
33186 #[doc = ""]
33187 #[doc = "ID: 91"]
33188 HIL_CONTROLS(HIL_CONTROLS_DATA),
33189 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
33190 #[doc = ""]
33191 #[doc = "ID: 113"]
33192 HIL_GPS(HIL_GPS_DATA),
33193 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
33194 #[doc = ""]
33195 #[doc = "ID: 114"]
33196 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
33197 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
33198 #[doc = ""]
33199 #[doc = "ID: 92"]
33200 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
33201 #[doc = "The IMU readings in SI units in NED body frame."]
33202 #[doc = ""]
33203 #[doc = "ID: 107"]
33204 HIL_SENSOR(HIL_SENSOR_DATA),
33205 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
33206 #[doc = ""]
33207 #[doc = "ID: 90"]
33208 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
33209 HIL_STATE(HIL_STATE_DATA),
33210 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
33211 #[doc = ""]
33212 #[doc = "ID: 115"]
33213 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
33214 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
33215 #[doc = ""]
33216 #[doc = "ID: 242"]
33217 HOME_POSITION(HOME_POSITION_DATA),
33218 #[doc = "Temperature and humidity from hygrometer."]
33219 #[doc = ""]
33220 #[doc = "ID: 12920"]
33221 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
33222 #[doc = "Illuminator status."]
33223 #[doc = ""]
33224 #[doc = "ID: 440"]
33225 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
33226 #[doc = "Status of the Iridium SBD link."]
33227 #[doc = ""]
33228 #[doc = "ID: 335"]
33229 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
33230 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
33231 #[doc = ""]
33232 #[doc = "ID: 149"]
33233 LANDING_TARGET(LANDING_TARGET_DATA),
33234 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
33235 #[doc = ""]
33236 #[doc = "ID: 8"]
33237 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
33238 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33239 #[doc = ""]
33240 #[doc = "ID: 32"]
33241 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
33242 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33243 #[doc = ""]
33244 #[doc = "ID: 64"]
33245 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
33246 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33247 #[doc = ""]
33248 #[doc = "ID: 89"]
33249 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
33250 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
33251 #[doc = ""]
33252 #[doc = "ID: 268"]
33253 LOGGING_ACK(LOGGING_ACK_DATA),
33254 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
33255 #[doc = ""]
33256 #[doc = "ID: 266"]
33257 LOGGING_DATA(LOGGING_DATA_DATA),
33258 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
33259 #[doc = ""]
33260 #[doc = "ID: 267"]
33261 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
33262 #[doc = "Reply to LOG_REQUEST_DATA."]
33263 #[doc = ""]
33264 #[doc = "ID: 120"]
33265 LOG_DATA(LOG_DATA_DATA),
33266 #[doc = "Reply to LOG_REQUEST_LIST."]
33267 #[doc = ""]
33268 #[doc = "ID: 118"]
33269 LOG_ENTRY(LOG_ENTRY_DATA),
33270 #[doc = "Erase all logs."]
33271 #[doc = ""]
33272 #[doc = "ID: 121"]
33273 LOG_ERASE(LOG_ERASE_DATA),
33274 #[doc = "Request a chunk of a log."]
33275 #[doc = ""]
33276 #[doc = "ID: 119"]
33277 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
33278 #[doc = "Stop log transfer and resume normal logging."]
33279 #[doc = ""]
33280 #[doc = "ID: 122"]
33281 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
33282 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
33283 #[doc = ""]
33284 #[doc = "ID: 117"]
33285 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
33286 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
33287 #[doc = ""]
33288 #[doc = "ID: 192"]
33289 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
33290 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
33291 #[doc = ""]
33292 #[doc = "ID: 69"]
33293 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
33294 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
33295 #[doc = ""]
33296 #[doc = "ID: 81"]
33297 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
33298 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33299 #[doc = ""]
33300 #[doc = "ID: 249"]
33301 MEMORY_VECT(MEMORY_VECT_DATA),
33302 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
33303 #[doc = ""]
33304 #[doc = "ID: 244"]
33305 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
33306 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
33307 #[doc = ""]
33308 #[doc = "ID: 47"]
33309 MISSION_ACK(MISSION_ACK_DATA),
33310 #[doc = "Delete all mission items at once."]
33311 #[doc = ""]
33312 #[doc = "ID: 45"]
33313 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
33314 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
33315 #[doc = ""]
33316 #[doc = "ID: 44"]
33317 MISSION_COUNT(MISSION_COUNT_DATA),
33318 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
33319 #[doc = ""]
33320 #[doc = "ID: 42"]
33321 MISSION_CURRENT(MISSION_CURRENT_DATA),
33322 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33323 #[doc = ""]
33324 #[doc = "ID: 39"]
33325 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
33326 MISSION_ITEM(MISSION_ITEM_DATA),
33327 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33328 #[doc = ""]
33329 #[doc = "ID: 73"]
33330 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
33331 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
33332 #[doc = ""]
33333 #[doc = "ID: 46"]
33334 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
33335 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
33336 #[doc = ""]
33337 #[doc = "ID: 40"]
33338 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
33339 MISSION_REQUEST(MISSION_REQUEST_DATA),
33340 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
33341 #[doc = ""]
33342 #[doc = "ID: 51"]
33343 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
33344 #[doc = "Request the overall list of mission items from the system/component."]
33345 #[doc = ""]
33346 #[doc = "ID: 43"]
33347 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
33348 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
33349 #[doc = ""]
33350 #[doc = "ID: 37"]
33351 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
33352 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
33353 #[doc = ""]
33354 #[doc = "ID: 41"]
33355 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
33356 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
33357 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
33358 #[doc = ""]
33359 #[doc = "ID: 38"]
33360 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
33361 #[doc = "Orientation of a mount."]
33362 #[doc = ""]
33363 #[doc = "ID: 265"]
33364 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
33365 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
33366 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33367 #[doc = ""]
33368 #[doc = "ID: 251"]
33369 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
33370 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33371 #[doc = ""]
33372 #[doc = "ID: 252"]
33373 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
33374 #[doc = "The state of the navigation and position controller."]
33375 #[doc = ""]
33376 #[doc = "ID: 62"]
33377 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
33378 #[doc = "Accelerometer and Gyro biases from the navigation filter."]
33379 #[doc = ""]
33380 #[doc = "ID: 220"]
33381 NAV_FILTER_BIAS(NAV_FILTER_BIAS_DATA),
33382 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
33383 #[doc = ""]
33384 #[doc = "ID: 330"]
33385 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
33386 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
33387 #[doc = ""]
33388 #[doc = "ID: 331"]
33389 ODOMETRY(ODOMETRY_DATA),
33390 #[doc = "Hardware status sent by an onboard computer."]
33391 #[doc = ""]
33392 #[doc = "ID: 390"]
33393 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
33394 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
33395 #[doc = ""]
33396 #[doc = "ID: 12918"]
33397 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
33398 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
33399 #[doc = ""]
33400 #[doc = "ID: 12902"]
33401 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
33402 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
33403 #[doc = ""]
33404 #[doc = "ID: 12900"]
33405 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
33406 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
33407 #[doc = ""]
33408 #[doc = "ID: 12901"]
33409 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
33410 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
33411 #[doc = ""]
33412 #[doc = "ID: 12915"]
33413 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
33414 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
33415 #[doc = ""]
33416 #[doc = "ID: 12905"]
33417 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
33418 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
33419 #[doc = ""]
33420 #[doc = "ID: 12903"]
33421 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
33422 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
33423 #[doc = ""]
33424 #[doc = "ID: 12904"]
33425 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
33426 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
33427 #[doc = ""]
33428 #[doc = "ID: 12919"]
33429 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
33430 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
33431 #[doc = ""]
33432 #[doc = "ID: 100"]
33433 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
33434 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
33435 #[doc = ""]
33436 #[doc = "ID: 106"]
33437 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
33438 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
33439 #[doc = ""]
33440 #[doc = "ID: 360"]
33441 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
33442 #[doc = "Response from a PARAM_EXT_SET message."]
33443 #[doc = ""]
33444 #[doc = "ID: 324"]
33445 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
33446 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
33447 #[doc = ""]
33448 #[doc = "ID: 321"]
33449 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
33450 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
33451 #[doc = ""]
33452 #[doc = "ID: 320"]
33453 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
33454 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
33455 #[doc = ""]
33456 #[doc = "ID: 323"]
33457 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
33458 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
33459 #[doc = ""]
33460 #[doc = "ID: 322"]
33461 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
33462 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
33463 #[doc = ""]
33464 #[doc = "ID: 50"]
33465 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
33466 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33467 #[doc = ""]
33468 #[doc = "ID: 21"]
33469 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
33470 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
33471 #[doc = ""]
33472 #[doc = "ID: 20"]
33473 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
33474 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33475 #[doc = ""]
33476 #[doc = "ID: 23"]
33477 PARAM_SET(PARAM_SET_DATA),
33478 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33479 #[doc = ""]
33480 #[doc = "ID: 22"]
33481 PARAM_VALUE(PARAM_VALUE_DATA),
33482 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
33483 #[doc = ""]
33484 #[doc = "ID: 4"]
33485 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
33486 PING(PING_DATA),
33487 #[doc = "Control vehicle tone generation (buzzer)."]
33488 #[doc = ""]
33489 #[doc = "ID: 258"]
33490 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
33491 PLAY_TUNE(PLAY_TUNE_DATA),
33492 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
33493 #[doc = ""]
33494 #[doc = "ID: 400"]
33495 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
33496 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
33497 #[doc = ""]
33498 #[doc = "ID: 87"]
33499 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
33500 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
33501 #[doc = ""]
33502 #[doc = "ID: 85"]
33503 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
33504 #[doc = "Power supply status."]
33505 #[doc = ""]
33506 #[doc = "ID: 125"]
33507 POWER_STATUS(POWER_STATUS_DATA),
33508 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
33509 #[doc = ""]
33510 #[doc = "ID: 300"]
33511 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
33512 #[doc = "Complete set of calibration parameters for the radio."]
33513 #[doc = ""]
33514 #[doc = "ID: 221"]
33515 RADIO_CALIBRATION(RADIO_CALIBRATION_DATA),
33516 #[doc = "Status generated by radio and injected into MAVLink stream."]
33517 #[doc = ""]
33518 #[doc = "ID: 109"]
33519 RADIO_STATUS(RADIO_STATUS_DATA),
33520 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
33521 #[doc = ""]
33522 #[doc = "ID: 27"]
33523 RAW_IMU(RAW_IMU_DATA),
33524 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
33525 #[doc = ""]
33526 #[doc = "ID: 28"]
33527 RAW_PRESSURE(RAW_PRESSURE_DATA),
33528 #[doc = "RPM sensor data message."]
33529 #[doc = ""]
33530 #[doc = "ID: 339"]
33531 RAW_RPM(RAW_RPM_DATA),
33532 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33533 #[doc = ""]
33534 #[doc = "ID: 65"]
33535 RC_CHANNELS(RC_CHANNELS_DATA),
33536 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
33537 #[doc = ""]
33538 #[doc = "ID: 70"]
33539 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
33540 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33541 #[doc = ""]
33542 #[doc = "ID: 35"]
33543 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
33544 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
33545 #[doc = ""]
33546 #[doc = "ID: 34"]
33547 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
33548 #[doc = "Request a data stream."]
33549 #[doc = ""]
33550 #[doc = "ID: 66"]
33551 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
33552 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
33553 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
33554 #[doc = ""]
33555 #[doc = "ID: 412"]
33556 REQUEST_EVENT(REQUEST_EVENT_DATA),
33557 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
33558 #[doc = ""]
33559 #[doc = "ID: 142"]
33560 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
33561 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
33562 #[doc = ""]
33563 #[doc = "ID: 413"]
33564 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
33565 #[doc = "Read out the safety zone the MAV currently assumes."]
33566 #[doc = ""]
33567 #[doc = "ID: 55"]
33568 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
33569 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
33570 #[doc = ""]
33571 #[doc = "ID: 54"]
33572 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
33573 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
33574 #[doc = ""]
33575 #[doc = "ID: 26"]
33576 SCALED_IMU(SCALED_IMU_DATA),
33577 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
33578 #[doc = ""]
33579 #[doc = "ID: 116"]
33580 SCALED_IMU2(SCALED_IMU2_DATA),
33581 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
33582 #[doc = ""]
33583 #[doc = "ID: 129"]
33584 SCALED_IMU3(SCALED_IMU3_DATA),
33585 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
33586 #[doc = ""]
33587 #[doc = "ID: 29"]
33588 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
33589 #[doc = "Barometer readings for 2nd barometer."]
33590 #[doc = ""]
33591 #[doc = "ID: 137"]
33592 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
33593 #[doc = "Barometer readings for 3rd barometer."]
33594 #[doc = ""]
33595 #[doc = "ID: 143"]
33596 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
33597 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
33598 #[doc = ""]
33599 #[doc = "ID: 126"]
33600 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
33601 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
33602 #[doc = ""]
33603 #[doc = "ID: 36"]
33604 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
33605 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
33606 #[doc = ""]
33607 #[doc = "ID: 256"]
33608 SETUP_SIGNING(SETUP_SIGNING_DATA),
33609 #[doc = "Set the vehicle attitude and body angular rates."]
33610 #[doc = ""]
33611 #[doc = "ID: 139"]
33612 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
33613 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
33614 #[doc = ""]
33615 #[doc = "ID: 82"]
33616 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
33617 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
33618 #[doc = ""]
33619 #[doc = "ID: 48"]
33620 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
33621 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
33622 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
33623 #[doc = ""]
33624 #[doc = "ID: 243"]
33625 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
33626 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
33627 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
33628 #[doc = ""]
33629 #[doc = "ID: 11"]
33630 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
33631 SET_MODE(SET_MODE_DATA),
33632 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
33633 #[doc = ""]
33634 #[doc = "ID: 86"]
33635 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
33636 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
33637 #[doc = ""]
33638 #[doc = "ID: 84"]
33639 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
33640 #[doc = "Status of simulation environment, if used."]
33641 #[doc = ""]
33642 #[doc = "ID: 108"]
33643 SIM_STATE(SIM_STATE_DATA),
33644 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
33645 #[doc = ""]
33646 #[doc = "ID: 370"]
33647 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
33648 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
33649 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
33650 #[doc = ""]
33651 #[doc = "ID: 253"]
33652 STATUSTEXT(STATUSTEXT_DATA),
33653 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
33654 #[doc = ""]
33655 #[doc = "ID: 261"]
33656 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
33657 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
33658 #[doc = ""]
33659 #[doc = "ID: 401"]
33660 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
33661 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
33662 #[doc = ""]
33663 #[doc = "ID: 2"]
33664 SYSTEM_TIME(SYSTEM_TIME_DATA),
33665 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
33666 #[doc = ""]
33667 #[doc = "ID: 1"]
33668 SYS_STATUS(SYS_STATUS_DATA),
33669 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
33670 #[doc = ""]
33671 #[doc = "ID: 135"]
33672 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
33673 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33674 #[doc = ""]
33675 #[doc = "ID: 134"]
33676 TERRAIN_DATA(TERRAIN_DATA_DATA),
33677 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33678 #[doc = ""]
33679 #[doc = "ID: 136"]
33680 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
33681 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33682 #[doc = ""]
33683 #[doc = "ID: 133"]
33684 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
33685 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
33686 #[doc = ""]
33687 #[doc = "ID: 111"]
33688 TIMESYNC(TIMESYNC_DATA),
33689 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
33690 #[doc = ""]
33691 #[doc = "ID: 380"]
33692 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
33693 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
33694 #[doc = ""]
33695 #[doc = "ID: 333"]
33696 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
33697 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
33698 #[doc = ""]
33699 #[doc = "ID: 332"]
33700 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
33701 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
33702 #[doc = ""]
33703 #[doc = "ID: 385"]
33704 TUNNEL(TUNNEL_DATA),
33705 #[doc = "System status specific to ualberta uav."]
33706 #[doc = ""]
33707 #[doc = "ID: 222"]
33708 UALBERTA_SYS_STATUS(UALBERTA_SYS_STATUS_DATA),
33709 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
33710 #[doc = ""]
33711 #[doc = "ID: 311"]
33712 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
33713 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
33714 #[doc = ""]
33715 #[doc = "ID: 310"]
33716 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
33717 #[doc = "The global position resulting from GPS and sensor fusion."]
33718 #[doc = ""]
33719 #[doc = "ID: 340"]
33720 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
33721 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
33722 #[doc = ""]
33723 #[doc = "ID: 248"]
33724 V2_EXTENSION(V2_EXTENSION_DATA),
33725 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
33726 #[doc = ""]
33727 #[doc = "ID: 74"]
33728 VFR_HUD(VFR_HUD_DATA),
33729 #[doc = "Vibration levels and accelerometer clipping."]
33730 #[doc = ""]
33731 #[doc = "ID: 241"]
33732 VIBRATION(VIBRATION_DATA),
33733 #[doc = "Global position estimate from a Vicon motion system source."]
33734 #[doc = ""]
33735 #[doc = "ID: 104"]
33736 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
33737 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
33738 #[doc = ""]
33739 #[doc = "ID: 269"]
33740 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
33741 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
33742 #[doc = ""]
33743 #[doc = "ID: 270"]
33744 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
33745 #[doc = "Local position/attitude estimate from a vision source."]
33746 #[doc = ""]
33747 #[doc = "ID: 102"]
33748 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
33749 #[doc = "Speed estimate from a vision source."]
33750 #[doc = ""]
33751 #[doc = "ID: 103"]
33752 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33753 #[doc = "Cumulative distance traveled for each reported wheel."]
33754 #[doc = ""]
33755 #[doc = "ID: 9000"]
33756 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33757 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33758 #[doc = ""]
33759 #[doc = "ID: 299"]
33760 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33761 #[doc = "Winch status."]
33762 #[doc = ""]
33763 #[doc = "ID: 9005"]
33764 WINCH_STATUS(WINCH_STATUS_DATA),
33765 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33766 #[doc = ""]
33767 #[doc = "ID: 231"]
33768 WIND_COV(WIND_COV_DATA),
33769}
33770impl MavMessage {
33771 pub const fn all_ids() -> &'static [u32] {
33772 &[
33773 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33774 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33775 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33776 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33777 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33778 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33779 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33780 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33781 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33782 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33783 148u32, 149u32, 162u32, 192u32, 220u32, 221u32, 222u32, 225u32, 230u32, 231u32, 232u32,
33784 233u32, 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32,
33785 249u32, 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32,
33786 261u32, 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32,
33787 275u32, 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32,
33788 288u32, 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32,
33789 323u32, 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32,
33790 350u32, 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32,
33791 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32,
33792 435u32, 436u32, 437u32, 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32,
33793 12903u32, 12904u32, 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
33794 ]
33795 }
33796}
33797impl Message for MavMessage {
33798 fn parse(
33799 version: MavlinkVersion,
33800 id: u32,
33801 payload: &[u8],
33802 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33803 match id {
33804 ACTUATOR_CONTROL_TARGET_DATA::ID => {
33805 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33806 .map(Self::ACTUATOR_CONTROL_TARGET)
33807 }
33808 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
33809 .map(Self::ACTUATOR_OUTPUT_STATUS),
33810 ADSB_VEHICLE_DATA::ID => {
33811 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
33812 }
33813 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
33814 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
33815 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
33816 ATTITUDE_QUATERNION_DATA::ID => {
33817 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
33818 }
33819 ATTITUDE_QUATERNION_COV_DATA::ID => {
33820 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
33821 .map(Self::ATTITUDE_QUATERNION_COV)
33822 }
33823 ATTITUDE_TARGET_DATA::ID => {
33824 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
33825 }
33826 ATT_POS_MOCAP_DATA::ID => {
33827 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
33828 }
33829 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
33830 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33831 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
33832 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
33833 }
33834 AUTOPILOT_VERSION_DATA::ID => {
33835 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
33836 }
33837 AVAILABLE_MODES_DATA::ID => {
33838 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
33839 }
33840 AVAILABLE_MODES_MONITOR_DATA::ID => {
33841 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
33842 .map(Self::AVAILABLE_MODES_MONITOR)
33843 }
33844 BATTERY_INFO_DATA::ID => {
33845 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
33846 }
33847 BATTERY_STATUS_DATA::ID => {
33848 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
33849 }
33850 BUTTON_CHANGE_DATA::ID => {
33851 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
33852 }
33853 CAMERA_CAPTURE_STATUS_DATA::ID => {
33854 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
33855 }
33856 CAMERA_FOV_STATUS_DATA::ID => {
33857 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
33858 }
33859 CAMERA_IMAGE_CAPTURED_DATA::ID => {
33860 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
33861 }
33862 CAMERA_INFORMATION_DATA::ID => {
33863 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
33864 }
33865 CAMERA_SETTINGS_DATA::ID => {
33866 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
33867 }
33868 CAMERA_THERMAL_RANGE_DATA::ID => {
33869 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
33870 }
33871 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
33872 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
33873 .map(Self::CAMERA_TRACKING_GEO_STATUS)
33874 }
33875 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
33876 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
33877 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
33878 }
33879 CAMERA_TRIGGER_DATA::ID => {
33880 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
33881 }
33882 CANFD_FRAME_DATA::ID => {
33883 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
33884 }
33885 CAN_FILTER_MODIFY_DATA::ID => {
33886 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
33887 }
33888 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
33889 CELLULAR_CONFIG_DATA::ID => {
33890 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
33891 }
33892 CELLULAR_STATUS_DATA::ID => {
33893 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
33894 }
33895 CHANGE_OPERATOR_CONTROL_DATA::ID => {
33896 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
33897 .map(Self::CHANGE_OPERATOR_CONTROL)
33898 }
33899 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
33900 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
33901 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
33902 }
33903 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
33904 COMMAND_ACK_DATA::ID => {
33905 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
33906 }
33907 COMMAND_CANCEL_DATA::ID => {
33908 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
33909 }
33910 COMMAND_INT_DATA::ID => {
33911 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
33912 }
33913 COMMAND_LONG_DATA::ID => {
33914 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
33915 }
33916 COMPONENT_INFORMATION_DATA::ID => {
33917 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
33918 }
33919 COMPONENT_INFORMATION_BASIC_DATA::ID => {
33920 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
33921 .map(Self::COMPONENT_INFORMATION_BASIC)
33922 }
33923 COMPONENT_METADATA_DATA::ID => {
33924 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
33925 }
33926 CONTROL_SYSTEM_STATE_DATA::ID => {
33927 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
33928 }
33929 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
33930 .map(Self::CURRENT_EVENT_SEQUENCE),
33931 CURRENT_MODE_DATA::ID => {
33932 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
33933 }
33934 DATA_STREAM_DATA::ID => {
33935 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
33936 }
33937 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
33938 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
33939 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
33940 }
33941 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
33942 DEBUG_FLOAT_ARRAY_DATA::ID => {
33943 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
33944 }
33945 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
33946 DISTANCE_SENSOR_DATA::ID => {
33947 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
33948 }
33949 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
33950 ENCAPSULATED_DATA_DATA::ID => {
33951 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
33952 }
33953 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
33954 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
33955 ESTIMATOR_STATUS_DATA::ID => {
33956 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
33957 }
33958 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
33959 EXTENDED_SYS_STATE_DATA::ID => {
33960 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
33961 }
33962 FENCE_STATUS_DATA::ID => {
33963 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
33964 }
33965 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
33966 .map(Self::FILE_TRANSFER_PROTOCOL),
33967 FLIGHT_INFORMATION_DATA::ID => {
33968 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
33969 }
33970 FOLLOW_TARGET_DATA::ID => {
33971 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
33972 }
33973 FUEL_STATUS_DATA::ID => {
33974 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
33975 }
33976 GENERATOR_STATUS_DATA::ID => {
33977 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
33978 }
33979 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
33980 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
33981 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
33982 }
33983 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
33984 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
33985 .map(Self::GIMBAL_DEVICE_INFORMATION)
33986 }
33987 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
33988 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
33989 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
33990 }
33991 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
33992 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
33993 .map(Self::GIMBAL_MANAGER_INFORMATION)
33994 }
33995 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
33996 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
33997 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
33998 }
33999 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34000 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
34001 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
34002 }
34003 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
34004 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
34005 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
34006 }
34007 GIMBAL_MANAGER_STATUS_DATA::ID => {
34008 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
34009 }
34010 GLOBAL_POSITION_INT_DATA::ID => {
34011 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
34012 }
34013 GLOBAL_POSITION_INT_COV_DATA::ID => {
34014 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
34015 .map(Self::GLOBAL_POSITION_INT_COV)
34016 }
34017 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34018 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34019 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
34020 }
34021 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
34022 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
34023 GPS_GLOBAL_ORIGIN_DATA::ID => {
34024 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
34025 }
34026 GPS_INJECT_DATA_DATA::ID => {
34027 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
34028 }
34029 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
34030 GPS_RAW_INT_DATA::ID => {
34031 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
34032 }
34033 GPS_RTCM_DATA_DATA::ID => {
34034 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
34035 }
34036 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
34037 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
34038 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
34039 HIGHRES_IMU_DATA::ID => {
34040 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
34041 }
34042 HIGH_LATENCY_DATA::ID => {
34043 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
34044 }
34045 HIGH_LATENCY2_DATA::ID => {
34046 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
34047 }
34048 HIL_ACTUATOR_CONTROLS_DATA::ID => {
34049 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
34050 }
34051 HIL_CONTROLS_DATA::ID => {
34052 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
34053 }
34054 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
34055 HIL_OPTICAL_FLOW_DATA::ID => {
34056 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
34057 }
34058 HIL_RC_INPUTS_RAW_DATA::ID => {
34059 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
34060 }
34061 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
34062 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
34063 HIL_STATE_QUATERNION_DATA::ID => {
34064 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
34065 }
34066 HOME_POSITION_DATA::ID => {
34067 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
34068 }
34069 HYGROMETER_SENSOR_DATA::ID => {
34070 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
34071 }
34072 ILLUMINATOR_STATUS_DATA::ID => {
34073 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
34074 }
34075 ISBD_LINK_STATUS_DATA::ID => {
34076 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
34077 }
34078 LANDING_TARGET_DATA::ID => {
34079 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
34080 }
34081 LINK_NODE_STATUS_DATA::ID => {
34082 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
34083 }
34084 LOCAL_POSITION_NED_DATA::ID => {
34085 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
34086 }
34087 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
34088 .map(Self::LOCAL_POSITION_NED_COV),
34089 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34090 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
34091 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
34092 }
34093 LOGGING_ACK_DATA::ID => {
34094 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
34095 }
34096 LOGGING_DATA_DATA::ID => {
34097 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
34098 }
34099 LOGGING_DATA_ACKED_DATA::ID => {
34100 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
34101 }
34102 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
34103 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
34104 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
34105 LOG_REQUEST_DATA_DATA::ID => {
34106 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
34107 }
34108 LOG_REQUEST_END_DATA::ID => {
34109 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
34110 }
34111 LOG_REQUEST_LIST_DATA::ID => {
34112 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
34113 }
34114 MAG_CAL_REPORT_DATA::ID => {
34115 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
34116 }
34117 MANUAL_CONTROL_DATA::ID => {
34118 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
34119 }
34120 MANUAL_SETPOINT_DATA::ID => {
34121 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
34122 }
34123 MEMORY_VECT_DATA::ID => {
34124 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
34125 }
34126 MESSAGE_INTERVAL_DATA::ID => {
34127 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
34128 }
34129 MISSION_ACK_DATA::ID => {
34130 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
34131 }
34132 MISSION_CLEAR_ALL_DATA::ID => {
34133 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
34134 }
34135 MISSION_COUNT_DATA::ID => {
34136 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
34137 }
34138 MISSION_CURRENT_DATA::ID => {
34139 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
34140 }
34141 MISSION_ITEM_DATA::ID => {
34142 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
34143 }
34144 MISSION_ITEM_INT_DATA::ID => {
34145 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
34146 }
34147 MISSION_ITEM_REACHED_DATA::ID => {
34148 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
34149 }
34150 MISSION_REQUEST_DATA::ID => {
34151 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
34152 }
34153 MISSION_REQUEST_INT_DATA::ID => {
34154 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
34155 }
34156 MISSION_REQUEST_LIST_DATA::ID => {
34157 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
34158 }
34159 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
34160 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
34161 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
34162 }
34163 MISSION_SET_CURRENT_DATA::ID => {
34164 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
34165 }
34166 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
34167 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
34168 .map(Self::MISSION_WRITE_PARTIAL_LIST)
34169 }
34170 MOUNT_ORIENTATION_DATA::ID => {
34171 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
34172 }
34173 NAMED_VALUE_FLOAT_DATA::ID => {
34174 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
34175 }
34176 NAMED_VALUE_INT_DATA::ID => {
34177 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
34178 }
34179 NAV_CONTROLLER_OUTPUT_DATA::ID => {
34180 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
34181 }
34182 NAV_FILTER_BIAS_DATA::ID => {
34183 NAV_FILTER_BIAS_DATA::deser(version, payload).map(Self::NAV_FILTER_BIAS)
34184 }
34185 OBSTACLE_DISTANCE_DATA::ID => {
34186 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
34187 }
34188 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
34189 ONBOARD_COMPUTER_STATUS_DATA::ID => {
34190 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
34191 .map(Self::ONBOARD_COMPUTER_STATUS)
34192 }
34193 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
34194 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
34195 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
34196 }
34197 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
34198 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
34199 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
34200 }
34201 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
34202 .map(Self::OPEN_DRONE_ID_BASIC_ID),
34203 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
34204 .map(Self::OPEN_DRONE_ID_LOCATION),
34205 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
34206 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
34207 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
34208 }
34209 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
34210 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
34211 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
34212 }
34213 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
34214 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
34215 }
34216 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
34217 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
34218 }
34219 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
34220 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
34221 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
34222 }
34223 OPTICAL_FLOW_DATA::ID => {
34224 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
34225 }
34226 OPTICAL_FLOW_RAD_DATA::ID => {
34227 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
34228 }
34229 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
34230 .map(Self::ORBIT_EXECUTION_STATUS),
34231 PARAM_EXT_ACK_DATA::ID => {
34232 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
34233 }
34234 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
34235 .map(Self::PARAM_EXT_REQUEST_LIST),
34236 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
34237 .map(Self::PARAM_EXT_REQUEST_READ),
34238 PARAM_EXT_SET_DATA::ID => {
34239 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
34240 }
34241 PARAM_EXT_VALUE_DATA::ID => {
34242 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
34243 }
34244 PARAM_MAP_RC_DATA::ID => {
34245 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
34246 }
34247 PARAM_REQUEST_LIST_DATA::ID => {
34248 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
34249 }
34250 PARAM_REQUEST_READ_DATA::ID => {
34251 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
34252 }
34253 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
34254 PARAM_VALUE_DATA::ID => {
34255 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
34256 }
34257 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
34258 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
34259 PLAY_TUNE_V2_DATA::ID => {
34260 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
34261 }
34262 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34263 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34264 .map(Self::POSITION_TARGET_GLOBAL_INT)
34265 }
34266 POSITION_TARGET_LOCAL_NED_DATA::ID => {
34267 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34268 .map(Self::POSITION_TARGET_LOCAL_NED)
34269 }
34270 POWER_STATUS_DATA::ID => {
34271 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
34272 }
34273 PROTOCOL_VERSION_DATA::ID => {
34274 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
34275 }
34276 RADIO_CALIBRATION_DATA::ID => {
34277 RADIO_CALIBRATION_DATA::deser(version, payload).map(Self::RADIO_CALIBRATION)
34278 }
34279 RADIO_STATUS_DATA::ID => {
34280 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
34281 }
34282 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
34283 RAW_PRESSURE_DATA::ID => {
34284 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
34285 }
34286 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
34287 RC_CHANNELS_DATA::ID => {
34288 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
34289 }
34290 RC_CHANNELS_OVERRIDE_DATA::ID => {
34291 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
34292 }
34293 RC_CHANNELS_RAW_DATA::ID => {
34294 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
34295 }
34296 RC_CHANNELS_SCALED_DATA::ID => {
34297 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
34298 }
34299 REQUEST_DATA_STREAM_DATA::ID => {
34300 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
34301 }
34302 REQUEST_EVENT_DATA::ID => {
34303 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
34304 }
34305 RESOURCE_REQUEST_DATA::ID => {
34306 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
34307 }
34308 RESPONSE_EVENT_ERROR_DATA::ID => {
34309 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
34310 }
34311 SAFETY_ALLOWED_AREA_DATA::ID => {
34312 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
34313 }
34314 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
34315 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
34316 .map(Self::SAFETY_SET_ALLOWED_AREA)
34317 }
34318 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
34319 SCALED_IMU2_DATA::ID => {
34320 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
34321 }
34322 SCALED_IMU3_DATA::ID => {
34323 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
34324 }
34325 SCALED_PRESSURE_DATA::ID => {
34326 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
34327 }
34328 SCALED_PRESSURE2_DATA::ID => {
34329 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
34330 }
34331 SCALED_PRESSURE3_DATA::ID => {
34332 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
34333 }
34334 SERIAL_CONTROL_DATA::ID => {
34335 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
34336 }
34337 SERVO_OUTPUT_RAW_DATA::ID => {
34338 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
34339 }
34340 SETUP_SIGNING_DATA::ID => {
34341 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
34342 }
34343 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
34344 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
34345 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
34346 }
34347 SET_ATTITUDE_TARGET_DATA::ID => {
34348 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
34349 }
34350 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
34351 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
34352 }
34353 SET_HOME_POSITION_DATA::ID => {
34354 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
34355 }
34356 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
34357 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34358 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34359 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
34360 }
34361 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
34362 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34363 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
34364 }
34365 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
34366 SMART_BATTERY_INFO_DATA::ID => {
34367 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
34368 }
34369 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
34370 STORAGE_INFORMATION_DATA::ID => {
34371 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
34372 }
34373 SUPPORTED_TUNES_DATA::ID => {
34374 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
34375 }
34376 SYSTEM_TIME_DATA::ID => {
34377 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
34378 }
34379 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
34380 TERRAIN_CHECK_DATA::ID => {
34381 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
34382 }
34383 TERRAIN_DATA_DATA::ID => {
34384 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
34385 }
34386 TERRAIN_REPORT_DATA::ID => {
34387 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
34388 }
34389 TERRAIN_REQUEST_DATA::ID => {
34390 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
34391 }
34392 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
34393 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
34394 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
34395 .map(Self::TIME_ESTIMATE_TO_TARGET)
34396 }
34397 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34398 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
34399 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
34400 }
34401 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34402 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
34403 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
34404 }
34405 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
34406 UALBERTA_SYS_STATUS_DATA::ID => {
34407 UALBERTA_SYS_STATUS_DATA::deser(version, payload).map(Self::UALBERTA_SYS_STATUS)
34408 }
34409 UAVCAN_NODE_INFO_DATA::ID => {
34410 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
34411 }
34412 UAVCAN_NODE_STATUS_DATA::ID => {
34413 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
34414 }
34415 UTM_GLOBAL_POSITION_DATA::ID => {
34416 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
34417 }
34418 V2_EXTENSION_DATA::ID => {
34419 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
34420 }
34421 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
34422 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
34423 VICON_POSITION_ESTIMATE_DATA::ID => {
34424 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
34425 .map(Self::VICON_POSITION_ESTIMATE)
34426 }
34427 VIDEO_STREAM_INFORMATION_DATA::ID => {
34428 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
34429 .map(Self::VIDEO_STREAM_INFORMATION)
34430 }
34431 VIDEO_STREAM_STATUS_DATA::ID => {
34432 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
34433 }
34434 VISION_POSITION_ESTIMATE_DATA::ID => {
34435 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34436 .map(Self::VISION_POSITION_ESTIMATE)
34437 }
34438 VISION_SPEED_ESTIMATE_DATA::ID => {
34439 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
34440 }
34441 WHEEL_DISTANCE_DATA::ID => {
34442 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
34443 }
34444 WIFI_CONFIG_AP_DATA::ID => {
34445 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
34446 }
34447 WINCH_STATUS_DATA::ID => {
34448 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
34449 }
34450 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
34451 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
34452 }
34453 }
34454 fn message_name(&self) -> &'static str {
34455 match self {
34456 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
34457 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
34458 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
34459 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
34460 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
34461 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
34462 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
34463 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
34464 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
34465 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
34466 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
34467 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34468 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
34469 }
34470 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
34471 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
34472 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
34473 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
34474 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
34475 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
34476 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
34477 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
34478 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
34479 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
34480 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
34481 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
34482 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34483 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34484 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
34485 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
34486 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
34487 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
34488 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
34489 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
34490 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
34491 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34492 Self::COLLISION(..) => COLLISION_DATA::NAME,
34493 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
34494 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
34495 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
34496 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
34497 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
34498 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
34499 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
34500 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
34501 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
34502 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
34503 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
34504 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34505 Self::DEBUG(..) => DEBUG_DATA::NAME,
34506 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
34507 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
34508 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
34509 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
34510 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
34511 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
34512 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
34513 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
34514 Self::EVENT(..) => EVENT_DATA::NAME,
34515 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
34516 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
34517 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
34518 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
34519 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
34520 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
34521 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
34522 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34523 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34524 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34525 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34526 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34527 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34528 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
34529 }
34530 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34531 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
34532 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
34533 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
34534 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34535 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
34536 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
34537 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
34538 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
34539 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
34540 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
34541 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
34542 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
34543 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
34544 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
34545 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
34546 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
34547 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
34548 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
34549 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
34550 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
34551 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
34552 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
34553 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
34554 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
34555 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
34556 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
34557 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
34558 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
34559 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
34560 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
34561 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
34562 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
34563 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
34564 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34565 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
34566 }
34567 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
34568 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
34569 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
34570 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
34571 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
34572 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
34573 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
34574 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
34575 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
34576 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
34577 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
34578 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
34579 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
34580 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
34581 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
34582 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
34583 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
34584 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
34585 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
34586 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
34587 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
34588 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
34589 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
34590 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
34591 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34592 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
34593 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
34594 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
34595 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
34596 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
34597 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
34598 Self::NAV_FILTER_BIAS(..) => NAV_FILTER_BIAS_DATA::NAME,
34599 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
34600 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
34601 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
34602 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
34603 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
34604 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
34605 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
34606 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
34607 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
34608 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
34609 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
34610 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
34611 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
34612 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
34613 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
34614 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
34615 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
34616 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
34617 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
34618 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
34619 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
34620 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
34621 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
34622 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
34623 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
34624 Self::PING(..) => PING_DATA::NAME,
34625 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
34626 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
34627 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34628 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
34629 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
34630 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
34631 Self::RADIO_CALIBRATION(..) => RADIO_CALIBRATION_DATA::NAME,
34632 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
34633 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
34634 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
34635 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
34636 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
34637 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
34638 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
34639 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
34640 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
34641 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
34642 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
34643 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
34644 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
34645 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34646 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
34647 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
34648 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
34649 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
34650 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
34651 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
34652 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
34653 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
34654 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
34655 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34656 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
34657 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34658 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
34659 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
34660 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34661 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34662 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
34663 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
34664 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
34665 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
34666 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
34667 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
34668 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
34669 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
34670 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
34671 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
34672 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
34673 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
34674 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
34675 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
34676 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
34677 }
34678 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34679 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
34680 }
34681 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
34682 Self::UALBERTA_SYS_STATUS(..) => UALBERTA_SYS_STATUS_DATA::NAME,
34683 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
34684 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
34685 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
34686 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
34687 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
34688 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
34689 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
34690 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
34691 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
34692 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
34693 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
34694 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
34695 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
34696 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
34697 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
34698 }
34699 }
34700 fn message_id(&self) -> u32 {
34701 match self {
34702 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
34703 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
34704 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
34705 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
34706 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
34707 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
34708 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
34709 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
34710 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
34711 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
34712 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
34713 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34714 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
34715 }
34716 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
34717 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
34718 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
34719 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
34720 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
34721 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
34722 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
34723 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
34724 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
34725 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
34726 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
34727 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
34728 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34729 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34730 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
34731 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
34732 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
34733 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
34734 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
34735 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
34736 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
34737 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34738 Self::COLLISION(..) => COLLISION_DATA::ID,
34739 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
34740 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
34741 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
34742 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
34743 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
34744 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
34745 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
34746 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
34747 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
34748 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
34749 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
34750 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34751 Self::DEBUG(..) => DEBUG_DATA::ID,
34752 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
34753 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
34754 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
34755 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
34756 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
34757 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
34758 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
34759 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
34760 Self::EVENT(..) => EVENT_DATA::ID,
34761 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
34762 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
34763 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
34764 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
34765 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
34766 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
34767 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
34768 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34769 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
34770 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34771 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
34772 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34773 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34774 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
34775 }
34776 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34777 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
34778 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
34779 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
34780 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34781 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
34782 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
34783 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
34784 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
34785 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
34786 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
34787 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
34788 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
34789 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
34790 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
34791 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
34792 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
34793 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
34794 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
34795 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
34796 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
34797 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
34798 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
34799 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
34800 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
34801 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
34802 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
34803 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
34804 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
34805 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
34806 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
34807 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
34808 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
34809 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
34810 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34811 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
34812 }
34813 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
34814 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
34815 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
34816 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
34817 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
34818 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
34819 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
34820 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
34821 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
34822 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
34823 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
34824 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
34825 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
34826 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
34827 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
34828 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
34829 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
34830 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
34831 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
34832 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
34833 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
34834 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
34835 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
34836 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
34837 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34838 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
34839 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34840 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
34841 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
34842 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
34843 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
34844 Self::NAV_FILTER_BIAS(..) => NAV_FILTER_BIAS_DATA::ID,
34845 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
34846 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
34847 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
34848 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34849 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34850 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34851 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
34852 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34853 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34854 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
34855 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
34856 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34857 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
34858 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
34859 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
34860 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
34861 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
34862 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
34863 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
34864 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
34865 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
34866 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
34867 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
34868 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
34869 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
34870 Self::PING(..) => PING_DATA::ID,
34871 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
34872 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
34873 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
34874 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
34875 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
34876 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
34877 Self::RADIO_CALIBRATION(..) => RADIO_CALIBRATION_DATA::ID,
34878 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
34879 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
34880 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
34881 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
34882 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
34883 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
34884 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
34885 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
34886 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
34887 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
34888 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
34889 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
34890 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
34891 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
34892 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
34893 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
34894 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
34895 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
34896 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
34897 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
34898 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
34899 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
34900 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
34901 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34902 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
34903 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34904 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
34905 Self::SET_MODE(..) => SET_MODE_DATA::ID,
34906 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34907 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34908 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
34909 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
34910 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
34911 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
34912 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
34913 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
34914 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
34915 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
34916 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
34917 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
34918 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
34919 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
34920 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
34921 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34922 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34923 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
34924 }
34925 Self::TUNNEL(..) => TUNNEL_DATA::ID,
34926 Self::UALBERTA_SYS_STATUS(..) => UALBERTA_SYS_STATUS_DATA::ID,
34927 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
34928 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
34929 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
34930 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
34931 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
34932 Self::VIBRATION(..) => VIBRATION_DATA::ID,
34933 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
34934 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
34935 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
34936 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
34937 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
34938 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
34939 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
34940 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
34941 Self::WIND_COV(..) => WIND_COV_DATA::ID,
34942 }
34943 }
34944 fn message_id_from_name(name: &str) -> Option<u32> {
34945 match name {
34946 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
34947 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
34948 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
34949 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
34950 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
34951 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
34952 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
34953 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
34954 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
34955 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
34956 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
34957 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
34958 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
34959 }
34960 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
34961 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
34962 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
34963 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
34964 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
34965 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
34966 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
34967 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
34968 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
34969 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
34970 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
34971 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
34972 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
34973 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
34974 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
34975 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
34976 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
34977 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
34978 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
34979 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
34980 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
34981 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
34982 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
34983 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
34984 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
34985 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
34986 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
34987 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
34988 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
34989 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
34990 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
34991 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
34992 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
34993 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
34994 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
34995 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
34996 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
34997 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
34998 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
34999 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
35000 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
35001 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
35002 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
35003 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
35004 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
35005 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
35006 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
35007 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
35008 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
35009 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
35010 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
35011 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
35012 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
35013 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
35014 }
35015 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
35016 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
35017 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
35018 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
35019 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
35020 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
35021 }
35022 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
35023 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
35024 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
35025 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
35026 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
35027 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
35028 }
35029 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
35030 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
35031 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
35032 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
35033 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
35034 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
35035 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
35036 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
35037 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
35038 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
35039 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
35040 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
35041 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
35042 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
35043 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
35044 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
35045 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
35046 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
35047 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
35048 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
35049 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
35050 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
35051 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
35052 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
35053 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
35054 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
35055 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
35056 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
35057 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
35058 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
35059 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
35060 }
35061 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
35062 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
35063 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
35064 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
35065 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
35066 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
35067 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
35068 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
35069 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
35070 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
35071 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
35072 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
35073 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
35074 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
35075 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
35076 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
35077 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
35078 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
35079 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
35080 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
35081 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
35082 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
35083 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
35084 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
35085 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
35086 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
35087 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
35088 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
35089 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
35090 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
35091 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
35092 NAV_FILTER_BIAS_DATA::NAME => Some(NAV_FILTER_BIAS_DATA::ID),
35093 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
35094 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
35095 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
35096 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
35097 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
35098 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
35099 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
35100 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
35101 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
35102 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
35103 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
35104 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
35105 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
35106 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
35107 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
35108 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
35109 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
35110 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
35111 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
35112 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
35113 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
35114 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
35115 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
35116 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
35117 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
35118 PING_DATA::NAME => Some(PING_DATA::ID),
35119 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
35120 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
35121 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
35122 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
35123 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
35124 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
35125 RADIO_CALIBRATION_DATA::NAME => Some(RADIO_CALIBRATION_DATA::ID),
35126 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
35127 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
35128 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
35129 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
35130 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
35131 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
35132 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
35133 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
35134 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
35135 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
35136 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
35137 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
35138 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
35139 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
35140 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
35141 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
35142 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
35143 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
35144 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
35145 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
35146 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
35147 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
35148 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
35149 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
35150 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
35151 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
35152 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
35153 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
35154 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
35155 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
35156 }
35157 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
35158 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
35159 }
35160 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
35161 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
35162 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
35163 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
35164 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
35165 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
35166 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
35167 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
35168 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
35169 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
35170 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
35171 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
35172 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
35173 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
35174 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
35175 }
35176 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
35177 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
35178 }
35179 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
35180 UALBERTA_SYS_STATUS_DATA::NAME => Some(UALBERTA_SYS_STATUS_DATA::ID),
35181 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
35182 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
35183 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
35184 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
35185 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
35186 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
35187 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
35188 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
35189 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
35190 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
35191 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
35192 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
35193 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
35194 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
35195 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
35196 _ => None,
35197 }
35198 }
35199 fn default_message_from_id(id: u32) -> Option<Self> {
35200 match id {
35201 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35202 ACTUATOR_CONTROL_TARGET_DATA::default(),
35203 )),
35204 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35205 ACTUATOR_OUTPUT_STATUS_DATA::default(),
35206 )),
35207 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
35208 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
35209 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
35210 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
35211 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35212 ATTITUDE_QUATERNION_DATA::default(),
35213 )),
35214 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35215 ATTITUDE_QUATERNION_COV_DATA::default(),
35216 )),
35217 ATTITUDE_TARGET_DATA::ID => {
35218 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
35219 }
35220 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
35221 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
35222 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35223 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35224 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
35225 ))
35226 }
35227 AUTOPILOT_VERSION_DATA::ID => {
35228 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
35229 }
35230 AVAILABLE_MODES_DATA::ID => {
35231 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
35232 }
35233 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35234 AVAILABLE_MODES_MONITOR_DATA::default(),
35235 )),
35236 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
35237 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
35238 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
35239 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35240 CAMERA_CAPTURE_STATUS_DATA::default(),
35241 )),
35242 CAMERA_FOV_STATUS_DATA::ID => {
35243 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
35244 }
35245 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35246 CAMERA_IMAGE_CAPTURED_DATA::default(),
35247 )),
35248 CAMERA_INFORMATION_DATA::ID => {
35249 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
35250 }
35251 CAMERA_SETTINGS_DATA::ID => {
35252 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
35253 }
35254 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35255 CAMERA_THERMAL_RANGE_DATA::default(),
35256 )),
35257 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35258 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
35259 )),
35260 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35261 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
35262 )),
35263 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
35264 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
35265 CAN_FILTER_MODIFY_DATA::ID => {
35266 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
35267 }
35268 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
35269 CELLULAR_CONFIG_DATA::ID => {
35270 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
35271 }
35272 CELLULAR_STATUS_DATA::ID => {
35273 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
35274 }
35275 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35276 CHANGE_OPERATOR_CONTROL_DATA::default(),
35277 )),
35278 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35279 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
35280 )),
35281 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
35282 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
35283 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
35284 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
35285 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
35286 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35287 COMPONENT_INFORMATION_DATA::default(),
35288 )),
35289 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35290 COMPONENT_INFORMATION_BASIC_DATA::default(),
35291 )),
35292 COMPONENT_METADATA_DATA::ID => {
35293 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
35294 }
35295 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35296 CONTROL_SYSTEM_STATE_DATA::default(),
35297 )),
35298 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35299 CURRENT_EVENT_SEQUENCE_DATA::default(),
35300 )),
35301 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
35302 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
35303 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35304 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
35305 )),
35306 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
35307 DEBUG_FLOAT_ARRAY_DATA::ID => {
35308 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
35309 }
35310 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
35311 DISTANCE_SENSOR_DATA::ID => {
35312 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
35313 }
35314 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
35315 ENCAPSULATED_DATA_DATA::ID => {
35316 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
35317 }
35318 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
35319 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
35320 ESTIMATOR_STATUS_DATA::ID => {
35321 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
35322 }
35323 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
35324 EXTENDED_SYS_STATE_DATA::ID => {
35325 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
35326 }
35327 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
35328 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35329 FILE_TRANSFER_PROTOCOL_DATA::default(),
35330 )),
35331 FLIGHT_INFORMATION_DATA::ID => {
35332 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
35333 }
35334 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
35335 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
35336 GENERATOR_STATUS_DATA::ID => {
35337 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
35338 }
35339 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35340 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
35341 )),
35342 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35343 GIMBAL_DEVICE_INFORMATION_DATA::default(),
35344 )),
35345 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35346 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
35347 )),
35348 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35349 GIMBAL_MANAGER_INFORMATION_DATA::default(),
35350 )),
35351 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35352 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
35353 )),
35354 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35355 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35356 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
35357 ))
35358 }
35359 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35360 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
35361 )),
35362 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35363 GIMBAL_MANAGER_STATUS_DATA::default(),
35364 )),
35365 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35366 GLOBAL_POSITION_INT_DATA::default(),
35367 )),
35368 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35369 GLOBAL_POSITION_INT_COV_DATA::default(),
35370 )),
35371 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35372 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35373 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
35374 ))
35375 }
35376 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
35377 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
35378 GPS_GLOBAL_ORIGIN_DATA::ID => {
35379 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
35380 }
35381 GPS_INJECT_DATA_DATA::ID => {
35382 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
35383 }
35384 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
35385 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
35386 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
35387 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
35388 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
35389 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
35390 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
35391 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
35392 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
35393 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35394 HIL_ACTUATOR_CONTROLS_DATA::default(),
35395 )),
35396 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
35397 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
35398 HIL_OPTICAL_FLOW_DATA::ID => {
35399 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
35400 }
35401 HIL_RC_INPUTS_RAW_DATA::ID => {
35402 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
35403 }
35404 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
35405 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
35406 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35407 HIL_STATE_QUATERNION_DATA::default(),
35408 )),
35409 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
35410 HYGROMETER_SENSOR_DATA::ID => {
35411 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
35412 }
35413 ILLUMINATOR_STATUS_DATA::ID => {
35414 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
35415 }
35416 ISBD_LINK_STATUS_DATA::ID => {
35417 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
35418 }
35419 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
35420 LINK_NODE_STATUS_DATA::ID => {
35421 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
35422 }
35423 LOCAL_POSITION_NED_DATA::ID => {
35424 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
35425 }
35426 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35427 LOCAL_POSITION_NED_COV_DATA::default(),
35428 )),
35429 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35430 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35431 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
35432 ))
35433 }
35434 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
35435 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
35436 LOGGING_DATA_ACKED_DATA::ID => {
35437 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
35438 }
35439 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
35440 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
35441 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
35442 LOG_REQUEST_DATA_DATA::ID => {
35443 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
35444 }
35445 LOG_REQUEST_END_DATA::ID => {
35446 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
35447 }
35448 LOG_REQUEST_LIST_DATA::ID => {
35449 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
35450 }
35451 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
35452 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
35453 MANUAL_SETPOINT_DATA::ID => {
35454 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
35455 }
35456 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
35457 MESSAGE_INTERVAL_DATA::ID => {
35458 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
35459 }
35460 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
35461 MISSION_CLEAR_ALL_DATA::ID => {
35462 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
35463 }
35464 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
35465 MISSION_CURRENT_DATA::ID => {
35466 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
35467 }
35468 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
35469 MISSION_ITEM_INT_DATA::ID => {
35470 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
35471 }
35472 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35473 MISSION_ITEM_REACHED_DATA::default(),
35474 )),
35475 MISSION_REQUEST_DATA::ID => {
35476 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
35477 }
35478 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35479 MISSION_REQUEST_INT_DATA::default(),
35480 )),
35481 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35482 MISSION_REQUEST_LIST_DATA::default(),
35483 )),
35484 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35485 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
35486 )),
35487 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35488 MISSION_SET_CURRENT_DATA::default(),
35489 )),
35490 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35491 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
35492 )),
35493 MOUNT_ORIENTATION_DATA::ID => {
35494 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
35495 }
35496 NAMED_VALUE_FLOAT_DATA::ID => {
35497 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
35498 }
35499 NAMED_VALUE_INT_DATA::ID => {
35500 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
35501 }
35502 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35503 NAV_CONTROLLER_OUTPUT_DATA::default(),
35504 )),
35505 NAV_FILTER_BIAS_DATA::ID => {
35506 Some(Self::NAV_FILTER_BIAS(NAV_FILTER_BIAS_DATA::default()))
35507 }
35508 OBSTACLE_DISTANCE_DATA::ID => {
35509 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
35510 }
35511 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
35512 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35513 ONBOARD_COMPUTER_STATUS_DATA::default(),
35514 )),
35515 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35516 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
35517 )),
35518 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35519 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
35520 )),
35521 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35522 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
35523 )),
35524 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35525 OPEN_DRONE_ID_LOCATION_DATA::default(),
35526 )),
35527 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35528 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
35529 )),
35530 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35531 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
35532 )),
35533 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35534 OPEN_DRONE_ID_SELF_ID_DATA::default(),
35535 )),
35536 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35537 OPEN_DRONE_ID_SYSTEM_DATA::default(),
35538 )),
35539 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35540 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
35541 )),
35542 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
35543 OPTICAL_FLOW_RAD_DATA::ID => {
35544 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
35545 }
35546 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35547 ORBIT_EXECUTION_STATUS_DATA::default(),
35548 )),
35549 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
35550 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35551 PARAM_EXT_REQUEST_LIST_DATA::default(),
35552 )),
35553 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35554 PARAM_EXT_REQUEST_READ_DATA::default(),
35555 )),
35556 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
35557 PARAM_EXT_VALUE_DATA::ID => {
35558 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
35559 }
35560 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
35561 PARAM_REQUEST_LIST_DATA::ID => {
35562 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
35563 }
35564 PARAM_REQUEST_READ_DATA::ID => {
35565 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
35566 }
35567 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
35568 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
35569 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
35570 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
35571 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
35572 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35573 POSITION_TARGET_GLOBAL_INT_DATA::default(),
35574 )),
35575 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35576 POSITION_TARGET_LOCAL_NED_DATA::default(),
35577 )),
35578 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
35579 PROTOCOL_VERSION_DATA::ID => {
35580 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
35581 }
35582 RADIO_CALIBRATION_DATA::ID => {
35583 Some(Self::RADIO_CALIBRATION(RADIO_CALIBRATION_DATA::default()))
35584 }
35585 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
35586 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
35587 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
35588 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
35589 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
35590 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35591 RC_CHANNELS_OVERRIDE_DATA::default(),
35592 )),
35593 RC_CHANNELS_RAW_DATA::ID => {
35594 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
35595 }
35596 RC_CHANNELS_SCALED_DATA::ID => {
35597 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
35598 }
35599 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35600 REQUEST_DATA_STREAM_DATA::default(),
35601 )),
35602 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
35603 RESOURCE_REQUEST_DATA::ID => {
35604 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
35605 }
35606 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35607 RESPONSE_EVENT_ERROR_DATA::default(),
35608 )),
35609 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35610 SAFETY_ALLOWED_AREA_DATA::default(),
35611 )),
35612 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35613 SAFETY_SET_ALLOWED_AREA_DATA::default(),
35614 )),
35615 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
35616 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
35617 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
35618 SCALED_PRESSURE_DATA::ID => {
35619 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
35620 }
35621 SCALED_PRESSURE2_DATA::ID => {
35622 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
35623 }
35624 SCALED_PRESSURE3_DATA::ID => {
35625 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
35626 }
35627 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
35628 SERVO_OUTPUT_RAW_DATA::ID => {
35629 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
35630 }
35631 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
35632 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35633 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
35634 )),
35635 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35636 SET_ATTITUDE_TARGET_DATA::default(),
35637 )),
35638 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35639 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
35640 )),
35641 SET_HOME_POSITION_DATA::ID => {
35642 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
35643 }
35644 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
35645 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35646 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
35647 )),
35648 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35649 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
35650 )),
35651 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
35652 SMART_BATTERY_INFO_DATA::ID => {
35653 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
35654 }
35655 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
35656 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35657 STORAGE_INFORMATION_DATA::default(),
35658 )),
35659 SUPPORTED_TUNES_DATA::ID => {
35660 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
35661 }
35662 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
35663 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
35664 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
35665 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
35666 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
35667 TERRAIN_REQUEST_DATA::ID => {
35668 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
35669 }
35670 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
35671 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35672 TIME_ESTIMATE_TO_TARGET_DATA::default(),
35673 )),
35674 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35675 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35676 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
35677 ))
35678 }
35679 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35680 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35681 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
35682 ))
35683 }
35684 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
35685 UALBERTA_SYS_STATUS_DATA::ID => Some(Self::UALBERTA_SYS_STATUS(
35686 UALBERTA_SYS_STATUS_DATA::default(),
35687 )),
35688 UAVCAN_NODE_INFO_DATA::ID => {
35689 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
35690 }
35691 UAVCAN_NODE_STATUS_DATA::ID => {
35692 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
35693 }
35694 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35695 UTM_GLOBAL_POSITION_DATA::default(),
35696 )),
35697 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
35698 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
35699 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
35700 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35701 VICON_POSITION_ESTIMATE_DATA::default(),
35702 )),
35703 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35704 VIDEO_STREAM_INFORMATION_DATA::default(),
35705 )),
35706 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35707 VIDEO_STREAM_STATUS_DATA::default(),
35708 )),
35709 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35710 VISION_POSITION_ESTIMATE_DATA::default(),
35711 )),
35712 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35713 VISION_SPEED_ESTIMATE_DATA::default(),
35714 )),
35715 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
35716 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
35717 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
35718 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
35719 _ => None,
35720 }
35721 }
35722 #[cfg(feature = "arbitrary")]
35723 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
35724 match id {
35725 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35726 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35727 )),
35728 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35729 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
35730 )),
35731 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
35732 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
35733 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
35734 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
35735 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35736 ATTITUDE_QUATERNION_DATA::random(rng),
35737 )),
35738 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35739 ATTITUDE_QUATERNION_COV_DATA::random(rng),
35740 )),
35741 ATTITUDE_TARGET_DATA::ID => {
35742 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
35743 }
35744 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
35745 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
35746 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35747 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35748 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
35749 ))
35750 }
35751 AUTOPILOT_VERSION_DATA::ID => {
35752 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
35753 }
35754 AVAILABLE_MODES_DATA::ID => {
35755 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
35756 }
35757 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35758 AVAILABLE_MODES_MONITOR_DATA::random(rng),
35759 )),
35760 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
35761 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
35762 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
35763 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35764 CAMERA_CAPTURE_STATUS_DATA::random(rng),
35765 )),
35766 CAMERA_FOV_STATUS_DATA::ID => {
35767 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
35768 }
35769 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35770 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
35771 )),
35772 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
35773 CAMERA_INFORMATION_DATA::random(rng),
35774 )),
35775 CAMERA_SETTINGS_DATA::ID => {
35776 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
35777 }
35778 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35779 CAMERA_THERMAL_RANGE_DATA::random(rng),
35780 )),
35781 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35782 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
35783 )),
35784 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35785 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
35786 )),
35787 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
35788 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
35789 CAN_FILTER_MODIFY_DATA::ID => {
35790 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
35791 }
35792 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
35793 CELLULAR_CONFIG_DATA::ID => {
35794 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
35795 }
35796 CELLULAR_STATUS_DATA::ID => {
35797 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
35798 }
35799 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35800 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
35801 )),
35802 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35803 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
35804 )),
35805 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
35806 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
35807 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
35808 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
35809 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
35810 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35811 COMPONENT_INFORMATION_DATA::random(rng),
35812 )),
35813 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35814 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
35815 )),
35816 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
35817 COMPONENT_METADATA_DATA::random(rng),
35818 )),
35819 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35820 CONTROL_SYSTEM_STATE_DATA::random(rng),
35821 )),
35822 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35823 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
35824 )),
35825 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
35826 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
35827 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35828 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
35829 )),
35830 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
35831 DEBUG_FLOAT_ARRAY_DATA::ID => {
35832 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
35833 }
35834 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
35835 DISTANCE_SENSOR_DATA::ID => {
35836 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
35837 }
35838 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
35839 ENCAPSULATED_DATA_DATA::ID => {
35840 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
35841 }
35842 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
35843 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
35844 ESTIMATOR_STATUS_DATA::ID => {
35845 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
35846 }
35847 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
35848 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
35849 EXTENDED_SYS_STATE_DATA::random(rng),
35850 )),
35851 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
35852 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35853 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
35854 )),
35855 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
35856 FLIGHT_INFORMATION_DATA::random(rng),
35857 )),
35858 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
35859 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
35860 GENERATOR_STATUS_DATA::ID => {
35861 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
35862 }
35863 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35864 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
35865 )),
35866 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35867 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
35868 )),
35869 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35870 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
35871 )),
35872 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35873 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
35874 )),
35875 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35876 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
35877 )),
35878 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35879 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35880 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
35881 ))
35882 }
35883 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35884 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
35885 )),
35886 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35887 GIMBAL_MANAGER_STATUS_DATA::random(rng),
35888 )),
35889 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35890 GLOBAL_POSITION_INT_DATA::random(rng),
35891 )),
35892 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35893 GLOBAL_POSITION_INT_COV_DATA::random(rng),
35894 )),
35895 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35896 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35897 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
35898 ))
35899 }
35900 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
35901 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
35902 GPS_GLOBAL_ORIGIN_DATA::ID => {
35903 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
35904 }
35905 GPS_INJECT_DATA_DATA::ID => {
35906 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
35907 }
35908 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
35909 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
35910 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
35911 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
35912 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
35913 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
35914 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
35915 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
35916 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
35917 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35918 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
35919 )),
35920 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
35921 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
35922 HIL_OPTICAL_FLOW_DATA::ID => {
35923 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
35924 }
35925 HIL_RC_INPUTS_RAW_DATA::ID => {
35926 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
35927 }
35928 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
35929 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
35930 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35931 HIL_STATE_QUATERNION_DATA::random(rng),
35932 )),
35933 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
35934 HYGROMETER_SENSOR_DATA::ID => {
35935 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
35936 }
35937 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
35938 ILLUMINATOR_STATUS_DATA::random(rng),
35939 )),
35940 ISBD_LINK_STATUS_DATA::ID => {
35941 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
35942 }
35943 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
35944 LINK_NODE_STATUS_DATA::ID => {
35945 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
35946 }
35947 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
35948 LOCAL_POSITION_NED_DATA::random(rng),
35949 )),
35950 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35951 LOCAL_POSITION_NED_COV_DATA::random(rng),
35952 )),
35953 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35954 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35955 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
35956 ))
35957 }
35958 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
35959 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
35960 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
35961 LOGGING_DATA_ACKED_DATA::random(rng),
35962 )),
35963 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
35964 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
35965 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
35966 LOG_REQUEST_DATA_DATA::ID => {
35967 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
35968 }
35969 LOG_REQUEST_END_DATA::ID => {
35970 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
35971 }
35972 LOG_REQUEST_LIST_DATA::ID => {
35973 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
35974 }
35975 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
35976 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
35977 MANUAL_SETPOINT_DATA::ID => {
35978 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
35979 }
35980 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
35981 MESSAGE_INTERVAL_DATA::ID => {
35982 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
35983 }
35984 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
35985 MISSION_CLEAR_ALL_DATA::ID => {
35986 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
35987 }
35988 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
35989 MISSION_CURRENT_DATA::ID => {
35990 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
35991 }
35992 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
35993 MISSION_ITEM_INT_DATA::ID => {
35994 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
35995 }
35996 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35997 MISSION_ITEM_REACHED_DATA::random(rng),
35998 )),
35999 MISSION_REQUEST_DATA::ID => {
36000 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
36001 }
36002 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
36003 MISSION_REQUEST_INT_DATA::random(rng),
36004 )),
36005 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
36006 MISSION_REQUEST_LIST_DATA::random(rng),
36007 )),
36008 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
36009 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
36010 )),
36011 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
36012 MISSION_SET_CURRENT_DATA::random(rng),
36013 )),
36014 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
36015 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
36016 )),
36017 MOUNT_ORIENTATION_DATA::ID => {
36018 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
36019 }
36020 NAMED_VALUE_FLOAT_DATA::ID => {
36021 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
36022 }
36023 NAMED_VALUE_INT_DATA::ID => {
36024 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
36025 }
36026 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
36027 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
36028 )),
36029 NAV_FILTER_BIAS_DATA::ID => {
36030 Some(Self::NAV_FILTER_BIAS(NAV_FILTER_BIAS_DATA::random(rng)))
36031 }
36032 OBSTACLE_DISTANCE_DATA::ID => {
36033 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
36034 }
36035 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
36036 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
36037 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
36038 )),
36039 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
36040 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
36041 )),
36042 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
36043 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
36044 )),
36045 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
36046 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
36047 )),
36048 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
36049 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
36050 )),
36051 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
36052 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
36053 )),
36054 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
36055 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
36056 )),
36057 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
36058 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
36059 )),
36060 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
36061 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
36062 )),
36063 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
36064 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
36065 )),
36066 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
36067 OPTICAL_FLOW_RAD_DATA::ID => {
36068 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
36069 }
36070 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
36071 ORBIT_EXECUTION_STATUS_DATA::random(rng),
36072 )),
36073 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
36074 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
36075 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
36076 )),
36077 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
36078 PARAM_EXT_REQUEST_READ_DATA::random(rng),
36079 )),
36080 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
36081 PARAM_EXT_VALUE_DATA::ID => {
36082 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
36083 }
36084 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
36085 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
36086 PARAM_REQUEST_LIST_DATA::random(rng),
36087 )),
36088 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
36089 PARAM_REQUEST_READ_DATA::random(rng),
36090 )),
36091 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
36092 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
36093 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
36094 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
36095 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
36096 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
36097 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
36098 )),
36099 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
36100 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
36101 )),
36102 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
36103 PROTOCOL_VERSION_DATA::ID => {
36104 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
36105 }
36106 RADIO_CALIBRATION_DATA::ID => {
36107 Some(Self::RADIO_CALIBRATION(RADIO_CALIBRATION_DATA::random(rng)))
36108 }
36109 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
36110 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
36111 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
36112 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
36113 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
36114 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
36115 RC_CHANNELS_OVERRIDE_DATA::random(rng),
36116 )),
36117 RC_CHANNELS_RAW_DATA::ID => {
36118 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
36119 }
36120 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
36121 RC_CHANNELS_SCALED_DATA::random(rng),
36122 )),
36123 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
36124 REQUEST_DATA_STREAM_DATA::random(rng),
36125 )),
36126 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
36127 RESOURCE_REQUEST_DATA::ID => {
36128 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
36129 }
36130 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
36131 RESPONSE_EVENT_ERROR_DATA::random(rng),
36132 )),
36133 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
36134 SAFETY_ALLOWED_AREA_DATA::random(rng),
36135 )),
36136 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
36137 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
36138 )),
36139 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
36140 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
36141 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
36142 SCALED_PRESSURE_DATA::ID => {
36143 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
36144 }
36145 SCALED_PRESSURE2_DATA::ID => {
36146 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
36147 }
36148 SCALED_PRESSURE3_DATA::ID => {
36149 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
36150 }
36151 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
36152 SERVO_OUTPUT_RAW_DATA::ID => {
36153 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
36154 }
36155 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
36156 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
36157 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
36158 )),
36159 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
36160 SET_ATTITUDE_TARGET_DATA::random(rng),
36161 )),
36162 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
36163 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
36164 )),
36165 SET_HOME_POSITION_DATA::ID => {
36166 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
36167 }
36168 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
36169 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
36170 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
36171 )),
36172 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
36173 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
36174 )),
36175 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
36176 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
36177 SMART_BATTERY_INFO_DATA::random(rng),
36178 )),
36179 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
36180 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
36181 STORAGE_INFORMATION_DATA::random(rng),
36182 )),
36183 SUPPORTED_TUNES_DATA::ID => {
36184 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
36185 }
36186 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
36187 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
36188 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
36189 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
36190 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
36191 TERRAIN_REQUEST_DATA::ID => {
36192 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
36193 }
36194 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
36195 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
36196 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
36197 )),
36198 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36199 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
36200 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
36201 ))
36202 }
36203 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36204 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
36205 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
36206 ))
36207 }
36208 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
36209 UALBERTA_SYS_STATUS_DATA::ID => Some(Self::UALBERTA_SYS_STATUS(
36210 UALBERTA_SYS_STATUS_DATA::random(rng),
36211 )),
36212 UAVCAN_NODE_INFO_DATA::ID => {
36213 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
36214 }
36215 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
36216 UAVCAN_NODE_STATUS_DATA::random(rng),
36217 )),
36218 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
36219 UTM_GLOBAL_POSITION_DATA::random(rng),
36220 )),
36221 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
36222 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
36223 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
36224 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
36225 VICON_POSITION_ESTIMATE_DATA::random(rng),
36226 )),
36227 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
36228 VIDEO_STREAM_INFORMATION_DATA::random(rng),
36229 )),
36230 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
36231 VIDEO_STREAM_STATUS_DATA::random(rng),
36232 )),
36233 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
36234 VISION_POSITION_ESTIMATE_DATA::random(rng),
36235 )),
36236 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
36237 VISION_SPEED_ESTIMATE_DATA::random(rng),
36238 )),
36239 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
36240 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
36241 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
36242 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
36243 _ => None,
36244 }
36245 }
36246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36247 match self {
36248 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36249 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
36250 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
36251 Self::AIS_VESSEL(body) => body.ser(version, bytes),
36252 Self::ALTITUDE(body) => body.ser(version, bytes),
36253 Self::ATTITUDE(body) => body.ser(version, bytes),
36254 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
36255 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
36256 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
36257 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
36258 Self::AUTH_KEY(body) => body.ser(version, bytes),
36259 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
36260 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
36261 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
36262 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
36263 Self::BATTERY_INFO(body) => body.ser(version, bytes),
36264 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
36265 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
36266 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
36267 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
36268 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
36269 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
36270 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
36271 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
36272 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
36273 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
36274 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
36275 Self::CANFD_FRAME(body) => body.ser(version, bytes),
36276 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
36277 Self::CAN_FRAME(body) => body.ser(version, bytes),
36278 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
36279 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
36280 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
36281 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
36282 Self::COLLISION(body) => body.ser(version, bytes),
36283 Self::COMMAND_ACK(body) => body.ser(version, bytes),
36284 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
36285 Self::COMMAND_INT(body) => body.ser(version, bytes),
36286 Self::COMMAND_LONG(body) => body.ser(version, bytes),
36287 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
36288 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
36289 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
36290 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
36291 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
36292 Self::CURRENT_MODE(body) => body.ser(version, bytes),
36293 Self::DATA_STREAM(body) => body.ser(version, bytes),
36294 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
36295 Self::DEBUG(body) => body.ser(version, bytes),
36296 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
36297 Self::DEBUG_VECT(body) => body.ser(version, bytes),
36298 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
36299 Self::EFI_STATUS(body) => body.ser(version, bytes),
36300 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
36301 Self::ESC_INFO(body) => body.ser(version, bytes),
36302 Self::ESC_STATUS(body) => body.ser(version, bytes),
36303 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
36304 Self::EVENT(body) => body.ser(version, bytes),
36305 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
36306 Self::FENCE_STATUS(body) => body.ser(version, bytes),
36307 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
36308 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
36309 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
36310 Self::FUEL_STATUS(body) => body.ser(version, bytes),
36311 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
36312 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
36313 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
36314 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
36315 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
36316 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
36317 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
36318 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
36319 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
36320 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
36321 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
36322 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36323 Self::GPS2_RAW(body) => body.ser(version, bytes),
36324 Self::GPS2_RTK(body) => body.ser(version, bytes),
36325 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36326 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
36327 Self::GPS_INPUT(body) => body.ser(version, bytes),
36328 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
36329 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
36330 Self::GPS_RTK(body) => body.ser(version, bytes),
36331 Self::GPS_STATUS(body) => body.ser(version, bytes),
36332 Self::HEARTBEAT(body) => body.ser(version, bytes),
36333 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
36334 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
36335 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
36336 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
36337 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
36338 Self::HIL_GPS(body) => body.ser(version, bytes),
36339 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
36340 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
36341 Self::HIL_SENSOR(body) => body.ser(version, bytes),
36342 Self::HIL_STATE(body) => body.ser(version, bytes),
36343 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
36344 Self::HOME_POSITION(body) => body.ser(version, bytes),
36345 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
36346 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
36347 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
36348 Self::LANDING_TARGET(body) => body.ser(version, bytes),
36349 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
36350 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
36351 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
36352 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
36353 Self::LOGGING_ACK(body) => body.ser(version, bytes),
36354 Self::LOGGING_DATA(body) => body.ser(version, bytes),
36355 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
36356 Self::LOG_DATA(body) => body.ser(version, bytes),
36357 Self::LOG_ENTRY(body) => body.ser(version, bytes),
36358 Self::LOG_ERASE(body) => body.ser(version, bytes),
36359 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
36360 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
36361 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
36362 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
36363 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
36364 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
36365 Self::MEMORY_VECT(body) => body.ser(version, bytes),
36366 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
36367 Self::MISSION_ACK(body) => body.ser(version, bytes),
36368 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
36369 Self::MISSION_COUNT(body) => body.ser(version, bytes),
36370 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
36371 Self::MISSION_ITEM(body) => body.ser(version, bytes),
36372 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
36373 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
36374 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
36375 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
36376 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
36377 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
36378 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
36379 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
36380 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
36381 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
36382 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
36383 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
36384 Self::NAV_FILTER_BIAS(body) => body.ser(version, bytes),
36385 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
36386 Self::ODOMETRY(body) => body.ser(version, bytes),
36387 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
36388 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
36389 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
36390 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
36391 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
36392 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
36393 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
36394 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
36395 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
36396 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
36397 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
36398 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
36399 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
36400 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
36401 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
36402 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
36403 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
36404 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
36405 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
36406 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
36407 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
36408 Self::PARAM_SET(body) => body.ser(version, bytes),
36409 Self::PARAM_VALUE(body) => body.ser(version, bytes),
36410 Self::PING(body) => body.ser(version, bytes),
36411 Self::PLAY_TUNE(body) => body.ser(version, bytes),
36412 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
36413 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36414 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36415 Self::POWER_STATUS(body) => body.ser(version, bytes),
36416 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
36417 Self::RADIO_CALIBRATION(body) => body.ser(version, bytes),
36418 Self::RADIO_STATUS(body) => body.ser(version, bytes),
36419 Self::RAW_IMU(body) => body.ser(version, bytes),
36420 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
36421 Self::RAW_RPM(body) => body.ser(version, bytes),
36422 Self::RC_CHANNELS(body) => body.ser(version, bytes),
36423 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
36424 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
36425 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
36426 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
36427 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
36428 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
36429 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
36430 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
36431 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
36432 Self::SCALED_IMU(body) => body.ser(version, bytes),
36433 Self::SCALED_IMU2(body) => body.ser(version, bytes),
36434 Self::SCALED_IMU3(body) => body.ser(version, bytes),
36435 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
36436 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
36437 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
36438 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
36439 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
36440 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
36441 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36442 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
36443 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36444 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
36445 Self::SET_MODE(body) => body.ser(version, bytes),
36446 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36447 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36448 Self::SIM_STATE(body) => body.ser(version, bytes),
36449 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
36450 Self::STATUSTEXT(body) => body.ser(version, bytes),
36451 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
36452 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
36453 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
36454 Self::SYS_STATUS(body) => body.ser(version, bytes),
36455 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
36456 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
36457 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
36458 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
36459 Self::TIMESYNC(body) => body.ser(version, bytes),
36460 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
36461 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
36462 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
36463 Self::TUNNEL(body) => body.ser(version, bytes),
36464 Self::UALBERTA_SYS_STATUS(body) => body.ser(version, bytes),
36465 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
36466 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
36467 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
36468 Self::V2_EXTENSION(body) => body.ser(version, bytes),
36469 Self::VFR_HUD(body) => body.ser(version, bytes),
36470 Self::VIBRATION(body) => body.ser(version, bytes),
36471 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36472 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
36473 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
36474 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36475 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
36476 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
36477 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
36478 Self::WINCH_STATUS(body) => body.ser(version, bytes),
36479 Self::WIND_COV(body) => body.ser(version, bytes),
36480 }
36481 }
36482 fn extra_crc(id: u32) -> u8 {
36483 match id {
36484 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36485 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
36486 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
36487 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
36488 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
36489 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
36490 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
36491 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
36492 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
36493 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
36494 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
36495 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36496 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
36497 }
36498 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
36499 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
36500 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
36501 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
36502 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
36503 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
36504 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
36505 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
36506 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
36507 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
36508 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
36509 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
36510 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
36511 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
36512 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
36513 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
36514 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
36515 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
36516 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
36517 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
36518 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
36519 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
36520 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
36521 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
36522 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
36523 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
36524 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
36525 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
36526 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
36527 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
36528 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
36529 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
36530 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
36531 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
36532 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
36533 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
36534 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
36535 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
36536 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
36537 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
36538 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
36539 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
36540 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
36541 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
36542 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
36543 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
36544 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
36545 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
36546 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
36547 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
36548 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
36549 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
36550 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
36551 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
36552 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
36553 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
36554 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
36555 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36556 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
36557 }
36558 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
36559 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
36560 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
36561 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
36562 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36563 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
36564 }
36565 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
36566 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
36567 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36568 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
36569 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
36570 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
36571 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
36572 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
36573 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
36574 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
36575 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
36576 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
36577 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
36578 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
36579 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
36580 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
36581 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
36582 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
36583 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
36584 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
36585 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
36586 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
36587 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
36588 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
36589 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
36590 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
36591 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
36592 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
36593 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
36594 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36595 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
36596 }
36597 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
36598 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
36599 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
36600 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
36601 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
36602 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
36603 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
36604 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
36605 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
36606 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
36607 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
36608 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
36609 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
36610 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
36611 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
36612 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
36613 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
36614 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
36615 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
36616 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
36617 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
36618 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
36619 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
36620 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
36621 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
36622 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
36623 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
36624 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
36625 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
36626 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
36627 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
36628 NAV_FILTER_BIAS_DATA::ID => NAV_FILTER_BIAS_DATA::EXTRA_CRC,
36629 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
36630 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
36631 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
36632 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
36633 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
36634 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
36635 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
36636 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
36637 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
36638 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
36639 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
36640 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
36641 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
36642 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
36643 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
36644 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
36645 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
36646 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
36647 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
36648 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
36649 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
36650 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
36651 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
36652 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
36653 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
36654 PING_DATA::ID => PING_DATA::EXTRA_CRC,
36655 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
36656 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
36657 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
36658 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36659 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
36660 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
36661 RADIO_CALIBRATION_DATA::ID => RADIO_CALIBRATION_DATA::EXTRA_CRC,
36662 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
36663 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
36664 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
36665 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
36666 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
36667 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
36668 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
36669 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
36670 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
36671 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
36672 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
36673 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
36674 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
36675 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
36676 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
36677 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
36678 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
36679 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
36680 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
36681 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
36682 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
36683 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
36684 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
36685 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36686 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
36687 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36688 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
36689 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
36690 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36691 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
36692 }
36693 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36694 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
36695 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
36696 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
36697 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
36698 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
36699 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
36700 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
36701 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
36702 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
36703 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
36704 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
36705 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
36706 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
36707 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36708 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
36709 }
36710 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36711 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
36712 }
36713 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
36714 UALBERTA_SYS_STATUS_DATA::ID => UALBERTA_SYS_STATUS_DATA::EXTRA_CRC,
36715 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
36716 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
36717 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
36718 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
36719 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
36720 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
36721 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36722 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
36723 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
36724 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36725 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
36726 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
36727 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
36728 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
36729 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
36730 _ => 0,
36731 }
36732 }
36733 fn target_system_id(&self) -> Option<u8> {
36734 match self {
36735 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
36736 Self::CANFD_FRAME(inner) => Some(inner.target_system),
36737 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
36738 Self::CAN_FRAME(inner) => Some(inner.target_system),
36739 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
36740 Self::COMMAND_ACK(inner) => Some(inner.target_system),
36741 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
36742 Self::COMMAND_INT(inner) => Some(inner.target_system),
36743 Self::COMMAND_LONG(inner) => Some(inner.target_system),
36744 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
36745 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
36746 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
36747 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
36748 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
36749 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
36750 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
36751 Self::LOGGING_ACK(inner) => Some(inner.target_system),
36752 Self::LOGGING_DATA(inner) => Some(inner.target_system),
36753 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
36754 Self::LOG_ERASE(inner) => Some(inner.target_system),
36755 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
36756 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
36757 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
36758 Self::MISSION_ACK(inner) => Some(inner.target_system),
36759 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
36760 Self::MISSION_COUNT(inner) => Some(inner.target_system),
36761 Self::MISSION_ITEM(inner) => Some(inner.target_system),
36762 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
36763 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
36764 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
36765 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
36766 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
36767 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
36768 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
36769 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
36770 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
36771 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
36772 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
36773 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
36774 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
36775 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
36776 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
36777 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
36778 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
36779 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
36780 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
36781 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
36782 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
36783 Self::PARAM_SET(inner) => Some(inner.target_system),
36784 Self::PING(inner) => Some(inner.target_system),
36785 Self::PLAY_TUNE(inner) => Some(inner.target_system),
36786 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
36787 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
36788 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
36789 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
36790 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
36791 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
36792 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
36793 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
36794 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
36795 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
36796 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
36797 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
36798 Self::SET_MODE(inner) => Some(inner.target_system),
36799 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
36800 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
36801 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
36802 Self::TIMESYNC(inner) => Some(inner.target_system),
36803 Self::TUNNEL(inner) => Some(inner.target_system),
36804 Self::V2_EXTENSION(inner) => Some(inner.target_system),
36805 _ => None,
36806 }
36807 }
36808 fn target_component_id(&self) -> Option<u8> {
36809 match self {
36810 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
36811 Self::CANFD_FRAME(inner) => Some(inner.target_component),
36812 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
36813 Self::CAN_FRAME(inner) => Some(inner.target_component),
36814 Self::COMMAND_ACK(inner) => Some(inner.target_component),
36815 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
36816 Self::COMMAND_INT(inner) => Some(inner.target_component),
36817 Self::COMMAND_LONG(inner) => Some(inner.target_component),
36818 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
36819 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
36820 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
36821 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
36822 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
36823 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
36824 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
36825 Self::LOGGING_ACK(inner) => Some(inner.target_component),
36826 Self::LOGGING_DATA(inner) => Some(inner.target_component),
36827 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
36828 Self::LOG_ERASE(inner) => Some(inner.target_component),
36829 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
36830 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
36831 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
36832 Self::MISSION_ACK(inner) => Some(inner.target_component),
36833 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
36834 Self::MISSION_COUNT(inner) => Some(inner.target_component),
36835 Self::MISSION_ITEM(inner) => Some(inner.target_component),
36836 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
36837 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
36838 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
36839 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
36840 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
36841 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
36842 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
36843 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
36844 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
36845 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
36846 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
36847 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
36848 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
36849 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
36850 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
36851 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
36852 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
36853 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
36854 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
36855 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
36856 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
36857 Self::PARAM_SET(inner) => Some(inner.target_component),
36858 Self::PING(inner) => Some(inner.target_component),
36859 Self::PLAY_TUNE(inner) => Some(inner.target_component),
36860 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
36861 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
36862 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
36863 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
36864 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
36865 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
36866 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
36867 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
36868 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
36869 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
36870 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
36871 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
36872 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
36873 Self::TIMESYNC(inner) => Some(inner.target_component),
36874 Self::TUNNEL(inner) => Some(inner.target_component),
36875 Self::V2_EXTENSION(inner) => Some(inner.target_component),
36876 _ => None,
36877 }
36878 }
36879}